test: make liveness and search-path tests portable to macOS
CI / test (pull_request) Successful in 3m17s
CI / test (pull_request) Successful in 3m17s
std.os.linux.getpid() is a raw Linux syscall (number 39), which maps to a different syscall on macOS, so it returned a bogus pid (or killed the test process with SIGSYS) when the suite ran on a Mac. Use the portable proc.currentPid() in the proc and recovery tests, and make the config search-path test expect the macOS user config dir on macOS. This clears the three pre-existing environment failures so 'zig build test' is green on both macOS and Linux.
This commit is contained in:
3 files changed
+7
-3
No files matched your search
+1
-1
@@ -185,7 +185,7 @@ test "signalTree kills the whole process group" {
|
||||
}
|
||||
|
||||
test "isAlive" {
|
||||
try std.testing.expect(isAlive(std.os.linux.getpid()));
|
||||
try std.testing.expect(isAlive(currentPid()));
|
||||
try std.testing.expect(!isAlive(-1));
|
||||
try std.testing.expect(!isAlive(0));
|
||||
}
|
||||
Reference in new issue
Block a user