mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
build: make test-incremental respect -Dtest-filter
This commit is contained in:
@@ -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
@@ -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}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user