diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-01 17:49:29 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-01 18:05:54 -0500 |
| commit | 9b8e23934bc87f1fd6a42cdfdd551212994b6e58 (patch) | |
| tree | 0ac63357b6504f7bf44e66002b0ccca49dc64b45 /test/tests.zig | |
| parent | 8bedb10939b511e39787b2693249d2d3e8102854 (diff) | |
| download | zig-9b8e23934bc87f1fd6a42cdfdd551212994b6e58.tar.gz zig-9b8e23934bc87f1fd6a42cdfdd551212994b6e58.zip | |
introduce --single-threaded build option
closes #1764
This adds another boolean to the test matrix; hopefully it does not
inflate the time too much.
std.event.Loop does not work with this option yet. See #1908
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/test/tests.zig b/test/tests.zig index 1ca06b4b34..73d4644d18 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -163,25 +163,32 @@ pub fn addPkgTests(b: *build.Builder, test_filter: ?[]const u8, root_src: []cons for (test_targets) |test_target| { const is_native = (test_target.os == builtin.os and test_target.arch == builtin.arch); for (modes) |mode| { - for ([]bool{ - false, - true, - }) |link_libc| { - if (link_libc and !is_native) { - // don't assume we have a cross-compiling libc set up - continue; - } - const these_tests = b.addTest(root_src); - these_tests.setNamePrefix(b.fmt("{}-{}-{}-{}-{} ", name, @tagName(test_target.os), @tagName(test_target.arch), @tagName(mode), if (link_libc) "c" else "bare")); - these_tests.setFilter(test_filter); - these_tests.setBuildMode(mode); - if (!is_native) { - these_tests.setTarget(test_target.arch, test_target.os, test_target.environ); - } - if (link_libc) { - these_tests.linkSystemLibrary("c"); + for ([]bool{ false, true }) |link_libc| { + for ([]bool{ false, true }) |single_threaded| { + if (link_libc and !is_native) { + // don't assume we have a cross-compiling libc set up + continue; + } + const these_tests = b.addTest(root_src); + these_tests.setNamePrefix(b.fmt( + "{}-{}-{}-{}-{}-{} ", + name, + @tagName(test_target.os), + @tagName(test_target.arch), + @tagName(mode), + if (link_libc) "c" else "bare", + if (single_threaded) "single" else "multi", + )); + these_tests.setFilter(test_filter); + these_tests.setBuildMode(mode); + if (!is_native) { + these_tests.setTarget(test_target.arch, test_target.os, test_target.environ); + } + if (link_libc) { + these_tests.linkSystemLibrary("c"); + } + step.dependOn(&these_tests.step); } - step.dependOn(&these_tests.step); } } } |
