diff options
| author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2021-03-04 12:18:04 +0000 |
|---|---|---|
| committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2021-03-04 12:18:04 +0000 |
| commit | 67cfc22ee228cee1a795ca1f7430165984fe1b04 (patch) | |
| tree | 2fed735bec569472ed1976e3a579c5d8f534160d | |
| parent | 4bb8425af60eb673a932c90ee8d1b5f24c13a34e (diff) | |
| download | rust-67cfc22ee228cee1a795ca1f7430165984fe1b04.tar.gz rust-67cfc22ee228cee1a795ca1f7430165984fe1b04.zip | |
ExitStatus stop signal display test: Make it Linux only
MacOS uses a different representation. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
| -rw-r--r-- | library/std/src/sys/unix/process/process_unix/tests.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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 60cb161aca2..3ab568eaa33 100644 --- a/library/std/src/sys/unix/process/process_unix/tests.rs +++ b/library/std/src/sys/unix/process/process_unix/tests.rs @@ -11,8 +11,13 @@ fn exitstatus_display_tests() { t(0x0008b, "signal: 11 (core dumped)"); t(0x00000, "exit code: 0"); t(0x0ff00, "exit code: 255"); - t(0x0137f, "stopped (not terminated) by signal: 19"); - t(0x0ffff, "continued (WIFCONTINUED)"); + + // On MacOS, 0x0137f is WIFCONTINUED, not WIFSTOPPED. Probably *BSD is similar. + // 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)"); // 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 |
