ExitStatus stop signal display test: Make it Linux only

MacOS uses a different representation.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
Ian Jackson 2021-03-04 12:18:04 +00:00
parent 4bb8425af6
commit 67cfc22ee2

View File

@ -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