diff --git a/build.zig b/build.zig index a9c38f3349..290d5e0735 100644 --- a/build.zig +++ b/build.zig @@ -743,7 +743,7 @@ pub fn build(b: *std.Build) !void { } const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases"); - try tests.addIncrementalTests(b, test_incremental_step); + try tests.addIncrementalTests(b, test_incremental_step, test_filters); if (!skip_test_incremental) test_step.dependOn(test_incremental_step); if (tests.addLibcTests(b, .{ diff --git a/test/tests.zig b/test/tests.zig index 5b68fc6880..551a26fa83 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -2682,7 +2682,7 @@ pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step return step; } -pub fn addIncrementalTests(b: *std.Build, test_step: *Step) !void { +pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []const []const u8) !void { const io = b.graph.io; const incr_check = b.addExecutable(.{ @@ -2701,6 +2701,10 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step) !void { while (try it.next(io)) |entry| { if (entry.kind != .file) continue; + for (test_filters) |test_filter| { + if (std.mem.indexOf(u8, entry.path, test_filter)) |_| break; + } else if (test_filters.len > 0) continue; + const run = b.addRunArtifact(incr_check); run.setName(b.fmt("incr-check '{s}'", .{entry.basename}));