From 11ca64401a5d562898e8b5f46bd36d6d1c6dc3ef Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 9 Mar 2021 10:53:03 +0000 Subject: Always compile the fragile wait status test cases, just run them conditionally Co-authored-by: David Tolnay --- library/std/src/sys/unix/process/process_unix/tests.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'library/std/src/sys') diff --git a/library/std/src/sys/unix/process/process_unix/tests.rs b/library/std/src/sys/unix/process/process_unix/tests.rs index 915402970f5..5819d2c2a5a 100644 --- a/library/std/src/sys/unix/process/process_unix/tests.rs +++ b/library/std/src/sys/unix/process/process_unix/tests.rs @@ -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")] - t(0x0137f, "stopped (not terminated) by signal: 19"); - #[cfg(target_os = "linux")] - t(0x0ffff, "continued (WIFCONTINUED)"); + if cfg!(target_os = "linux") { + t(0x0137f, "stopped (not terminated) by signal: 19"); + 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"))] - t(0x000ff, "unrecognised wait status: 255 0xff"); + if cfg!(all(target_os = "linux", target_env = "gnu")) { + t(0x000ff, "unrecognised wait status: 255 0xff"); + } } -- cgit 1.4.1-3-g733a5