aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-10 18:09:39 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-04-11 08:42:14 -0700
commit3c3cee2cfabc5d03bb83cf6cc6a8ed80f13ee1df (patch)
treeb440fbaf013ed472c39a60381928c0224e694f5c /test/tests.zig
parentd5eab33fd23351a8606cb69a846b1b753b4c7c4a (diff)
downloadzig-3c3cee2cfabc5d03bb83cf6cc6a8ed80f13ee1df.tar.gz
zig-3c3cee2cfabc5d03bb83cf6cc6a8ed80f13ee1df.zip
fix build logic due to state mutations and break the API accordingly
* remove setName, setFilter, and setTestRunner. Please set these options directly when creating the CompileStep. * removed unused field * remove computeOutFileNames and inline the logic, making clear the goal of avoiding state mutations after the build step is created.
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/tests.zig b/test/tests.zig
index a9bed635e2..18af132992 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -977,11 +977,11 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
.optimize = test_target.optimize_mode,
.target = test_target.target,
.max_rss = max_rss,
+ .filter = options.test_filter,
});
const single_threaded_txt = if (test_target.single_threaded) "single" else "multi";
const backend_txt = if (test_target.backend) |backend| @tagName(backend) else "default";
these_tests.single_threaded = test_target.single_threaded;
- these_tests.setFilter(options.test_filter);
if (test_target.link_libc) {
these_tests.linkSystemLibrary("c");
}
@@ -1037,10 +1037,15 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S
continue;
}
+ const triple_prefix = c_abi_target.zigTriple(b.allocator) catch @panic("OOM");
+
const test_step = b.addTest(.{
.root_source_file = .{ .path = "test/c_abi/main.zig" },
.optimize = optimize_mode,
.target = c_abi_target,
+ .name = b.fmt("test-c-abi-{s}-{s}", .{
+ triple_prefix, @tagName(optimize_mode),
+ }),
});
if (c_abi_target.abi != null and c_abi_target.abi.?.isMusl()) {
// TODO NativeTargetInfo insists on dynamically linking musl
@@ -1057,11 +1062,6 @@ pub fn addCAbiTests(b: *std.Build, skip_non_native: bool, skip_release: bool) *S
test_step.want_lto = false;
}
- const triple_prefix = c_abi_target.zigTriple(b.allocator) catch @panic("OOM");
- test_step.setName(b.fmt("test-c-abi-{s}-{s} ", .{
- triple_prefix, @tagName(optimize_mode),
- }));
-
const run = b.addRunArtifact(test_step);
run.skip_foreign_checks = true;
step.dependOn(&run.step);