build: make test-incremental respect -Dtest-filter

This commit is contained in:
Andrew Kelley
2025-12-24 14:36:58 -08:00
parent b243e8f8cc
commit 66da6773eb
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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, .{
+5 -1
View File
@@ -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}));