diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-02-07 00:31:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-07 00:31:17 -0500 |
| commit | 21135387fb7c2dbaf70a72f2c97341e9c1307045 (patch) | |
| tree | 5926ea2d182a76f80429776a5473202738c9b656 /src/test.zig | |
| parent | 069dd01ce4ced3cb9664e4f1e09be753cb3ed476 (diff) | |
| parent | 33fa29601921d88097a1ee3c0d92b93047a5186d (diff) | |
| download | zig-21135387fb7c2dbaf70a72f2c97341e9c1307045.tar.gz zig-21135387fb7c2dbaf70a72f2c97341e9c1307045.zip | |
Merge pull request #10782 from topolarity/gate-child-processes
Avoid depending on child process execution when not supported by host OS
Diffstat (limited to 'src/test.zig')
| -rw-r--r-- | src/test.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test.zig b/src/test.zig index e02ea04f1c..b73e11d7f5 100644 --- a/src/test.zig +++ b/src/test.zig @@ -730,6 +730,12 @@ pub const TestContext = struct { // * cannot handle updates // because of this we must spawn a child process rather than // using Compilation directly. + + if (!std.process.can_spawn) { + print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)}); + return; // Pass test. + } + assert(case.updates.items.len == 1); const update = case.updates.items[0]; try tmp.dir.writeFile(tmp_src_path, update.src); @@ -1104,6 +1110,11 @@ pub const TestContext = struct { } }, .Execution => |expected_stdout| { + if (!std.process.can_spawn) { + print("Unable to spawn child processes on {s}, skipping test.\n", .{@tagName(builtin.os.tag)}); + return; // Pass test. + } + update_node.setEstimatedTotalItems(4); var argv = std.ArrayList([]const u8).init(allocator); |
