Skip to content

Commit 67cfc22

Browse files
committed
ExitStatus stop signal display test: Make it Linux only
MacOS uses a different representation. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
1 parent 4bb8425 commit 67cfc22

File tree

1 file changed

+7
-2
lines changed
  • library/std/src/sys/unix/process/process_unix

1 file changed

+7
-2
lines changed

library/std/src/sys/unix/process/process_unix/tests.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ fn exitstatus_display_tests() {
1111
t(0x0008b, "signal: 11 (core dumped)");
1212
t(0x00000, "exit code: 0");
1313
t(0x0ff00, "exit code: 255");
14-
t(0x0137f, "stopped (not terminated) by signal: 19");
15-
t(0x0ffff, "continued (WIFCONTINUED)");
14+
15+
// On MacOS, 0x0137f is WIFCONTINUED, not WIFSTOPPED. Probably *BSD is similar.
16+
// https://github.com/rust-lang/rust/pull/82749#issuecomment-790525956
17+
// The purpose of this test is to test our string formatting, not our understanding of the wait
18+
// status magic numbers. So restrict these to Linux.
19+
#[cfg(target_os = "linux")] t(0x0137f, "stopped (not terminated) by signal: 19");
20+
#[cfg(target_os = "linux")] t(0x0ffff, "continued (WIFCONTINUED)");
1621

1722
// Testing "unrecognised wait status" is hard because the wait.h macros typically
1823
// assume that the value came from wait and isn't mad. With the glibc I have here

0 commit comments

Comments
 (0)