From 3c3cee2cfabc5d03bb83cf6cc6a8ed80f13ee1df Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 10 Apr 2023 18:09:39 -0700 Subject: 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. --- test/tests.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/tests.zig') 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); -- cgit v1.2.3