@@ -433,6 +433,7 @@ pub fn build(b: *std.Build) !void {
433
433
test_step .dependOn (test_cases_step );
434
434
435
435
const test_modules_step = b .step ("test-modules" , "Run the per-target module tests" );
436
+ test_step .dependOn (test_modules_step );
436
437
437
438
test_modules_step .dependOn (tests .addModuleTests (b , .{
438
439
.test_filters = test_filters ,
@@ -509,22 +510,24 @@ pub fn build(b: *std.Build) !void {
509
510
.max_rss = 5029889638 ,
510
511
}));
511
512
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 );
526
515
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 );
528
531
529
532
test_step .dependOn (tests .addCompareOutputTests (b , test_filters , optimization_modes ));
530
533
test_step .dependOn (tests .addStandaloneTests (
0 commit comments