Skip to content

Commit fe3a98d

Browse files
committed
build.zig: make unit tests not use the full matrix
1 parent 667d492 commit fe3a98d

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

build.zig

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ pub fn build(b: *std.Build) !void {
433433
test_step.dependOn(test_cases_step);
434434

435435
const test_modules_step = b.step("test-modules", "Run the per-target module tests");
436+
test_step.dependOn(test_modules_step);
436437

437438
test_modules_step.dependOn(tests.addModuleTests(b, .{
438439
.test_filters = test_filters,
@@ -509,22 +510,24 @@ pub fn build(b: *std.Build) !void {
509510
.max_rss = 5029889638,
510511
}));
511512

512-
test_modules_step.dependOn(tests.addModuleTests(b, .{
513-
.test_filters = test_filters,
514-
.test_target_filters = test_target_filters,
515-
.test_slow_targets = test_slow_targets,
516-
.root_src = "src/main.zig",
517-
.name = "compiler-internals",
518-
.desc = "Run the compiler internals tests",
519-
.optimize_modes = optimization_modes,
520-
.include_paths = &.{},
521-
.skip_single_threaded = skip_single_threaded,
522-
.skip_non_native = true,
523-
.skip_libc = skip_libc,
524-
.build_options = exe_options,
525-
}));
513+
const unit_tests_step = b.step("test-unit", "Run the compiler source unit tests");
514+
test_step.dependOn(unit_tests_step);
526515

527-
test_step.dependOn(test_modules_step);
516+
const unit_tests = b.addTest(.{
517+
.root_module = b.createModule(.{
518+
.root_source_file = b.path("src/main.zig"),
519+
.optimize = optimize,
520+
.target = target,
521+
.link_libc = link_libc,
522+
.single_threaded = single_threaded,
523+
}),
524+
.filters = test_filters,
525+
.use_llvm = use_llvm,
526+
.use_lld = use_llvm,
527+
.zig_lib_dir = b.path("lib"),
528+
});
529+
unit_tests.root_module.addOptions("build_options", exe_options);
530+
unit_tests_step.dependOn(&b.addRunArtifact(unit_tests).step);
528531

529532
test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes));
530533
test_step.dependOn(tests.addStandaloneTests(

0 commit comments

Comments
 (0)