authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-24 14:36:58-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-26 19:58:56-08:00
log66da6773ebd5b903c41972c0c81372d10571254d
treeeca776589d819d1840e9c09fe75218dd8f2f06f5
parentb243e8f8cc7ee27dfa7318d1c3698d01582e84ae

build: make test-incremental respect -Dtest-filter


2 files changed, 6 insertions(+), 2 deletions(-)

build.zig+1-1
...@@ -743,7 +743,7 @@ pub fn build(b: *std.Build) !void {...@@ -743,7 +743,7 @@ pub fn build(b: *std.Build) !void {
743 }743 }
744744
745 const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases");745 const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases");
746 try tests.addIncrementalTests(b, test_incremental_step);746 try tests.addIncrementalTests(b, test_incremental_step, test_filters);
747 if (!skip_test_incremental) test_step.dependOn(test_incremental_step);747 if (!skip_test_incremental) test_step.dependOn(test_incremental_step);
748748
749 if (tests.addLibcTests(b, .{749 if (tests.addLibcTests(b, .{
test/tests.zig+5-1
...@@ -2682,7 +2682,7 @@ pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step...@@ -2682,7 +2682,7 @@ pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step
2682 return step;2682 return step;
2683}2683}
26842684
2685pub fn addIncrementalTests(b: *std.Build, test_step: *Step) !void {2685pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []const []const u8) !void {
2686 const io = b.graph.io;2686 const io = b.graph.io;
26872687
2688 const incr_check = b.addExecutable(.{2688 const incr_check = b.addExecutable(.{
...@@ -2701,6 +2701,10 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step) !void {...@@ -2701,6 +2701,10 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step) !void {
2701 while (try it.next(io)) |entry| {2701 while (try it.next(io)) |entry| {
2702 if (entry.kind != .file) continue;2702 if (entry.kind != .file) continue;
27032703
2704 for (test_filters) |test_filter| {
2705 if (std.mem.indexOf(u8, entry.path, test_filter)) |_| break;
2706 } else if (test_filters.len > 0) continue;
2707
2704 const run = b.addRunArtifact(incr_check);2708 const run = b.addRunArtifact(incr_check);
2705 run.setName(b.fmt("incr-check '{s}'", .{entry.basename}));2709 run.setName(b.fmt("incr-check '{s}'", .{entry.basename}));
27062710