Add unstable option to ignore should_panic tests by memoryruins · Pull Request #58689 · rust-lang/rust (original) (raw)
Basically this would be a hack to make Miri somewhat more useful, but we'd have to be careful that we don't ever set cfg(miri)
in a situation where the code might also be run "for real". I am not sure if the libs team would accept such hacks in the compiler repo.
Having a --ignore-should-panic
makes somewhat more sense as there are "real" (non-Miri) platforms where abort=panic is the only possible implementation. @japaric have you ever wanted to run a test suite on (an emulator for) an embedded device, and had trouble because of panic=abort and should_panic
tests?
So I think I have come around to the conclusion that such a flag actually might make some sense. But then ignored tests should be treated just like those marked #[ignore]
, i.e., they should be printed as "Test ... ignored".
compiletest and the extracted compiletest-rs crate depend on libtest's
TestOpts
struct, which would mean that adding this flag could require fixing toolstate afterwards (and then doing so again when removing).
AFAIK the extracted crate carries a copy of this, so this should be fine from a toolstate perspective.