Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Z panic_abort_tests does not support #[bench] #103261

Closed
tmandry opened this issue Oct 19, 2022 · 2 comments
Closed

-Z panic_abort_tests does not support #[bench] #103261

tmandry opened this issue Oct 19, 2022 · 2 comments
Labels
A-libtest Area: #[test] related requires-nightly This issue requires a nightly compiler in some way. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@tmandry
Copy link
Member

tmandry commented Oct 19, 2022

If we try to run a test binary built with -Z panic-abort-tests and that test has a function with the #[bench] attribute, the binary will panic with the following error:

thread 'main' panicked at 'Cannot run dynamic test fn out-of-process', library/test/src/lib.rs:549:22

This is because we convert #[bench] to a test using DynTestFn when not running benchmarks, but DynTestFn is not supported with -Z panic-abort-tests, because we must run tests out of process and don't have a way to pass a closure to another process.

@tmandry tmandry added A-libtest Area: #[test] related requires-nightly This issue requires a nightly compiler in some way. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 19, 2022
@ehuss
Copy link
Contributor

ehuss commented Oct 19, 2022

I think this may be a duplicate of #73509?

@tmandry
Copy link
Member Author

tmandry commented Oct 20, 2022

Yep, thanks.

@tmandry tmandry closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 20, 2022
… r=tmandry

Adjusting test to needs-unwind, with linking issue

Test requires `needs-unwind` (see linked issue rust-lang#103261)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libtest Area: #[test] related requires-nightly This issue requires a nightly compiler in some way. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants