Always compile the fragile wait status test cases, just run them conditionally

Co-authored-by: David Tolnay <dtolnay@gmail.com>
This commit is contained in:
Ian Jackson 2021-03-09 10:53:03 +00:00 committed by GitHub
parent 8e4433ab3e
commit 11ca64401a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,14 +16,15 @@ fn exitstatus_display_tests() {
// https://github.com/rust-lang/rust/pull/82749#issuecomment-790525956
// The purpose of this test is to test our string formatting, not our understanding of the wait
// status magic numbers. So restrict these to Linux.
#[cfg(target_os = "linux")]
if cfg!(target_os = "linux") {
t(0x0137f, "stopped (not terminated) by signal: 19");
#[cfg(target_os = "linux")]
t(0x0ffff, "continued (WIFCONTINUED)");
}
// Testing "unrecognised wait status" is hard because the wait.h macros typically
// assume that the value came from wait and isn't mad. With the glibc I have here
// this works:
#[cfg(all(target_os = "linux", target_env = "gnu"))]
if cfg!(all(target_os = "linux", target_env = "gnu")) {
t(0x000ff, "unrecognised wait status: 255 0xff");
}
}