@@ -15,6 +15,7 @@ const stack_size = 32 * 1024 * 1024;
1515
1616pub fn build (b : * Builder ) ! void {
1717 b .setPreferredReleaseMode (.ReleaseFast );
18+ const test_step = b .step ("test" , "Run all the tests" );
1819 const mode = b .standardReleaseOptions ();
1920 const target = b .standardTargetOptions (.{});
2021 const single_threaded = b .option (bool , "single-threaded" , "Build artifacts that run in single threaded mode" );
@@ -39,8 +40,6 @@ pub fn build(b: *Builder) !void {
3940 const docs_step = b .step ("docs" , "Build documentation" );
4041 docs_step .dependOn (& docgen_cmd .step );
4142
42- const toolchain_step = b .step ("test-toolchain" , "Run the tests for the toolchain" );
43-
4443 var test_cases = b .addTest ("src/test.zig" );
4544 test_cases .stack_size = stack_size ;
4645 test_cases .setBuildMode (mode );
@@ -149,7 +148,7 @@ pub fn build(b: *Builder) !void {
149148 exe .setBuildMode (mode );
150149 exe .setTarget (target );
151150 if (! skip_stage2_tests ) {
152- toolchain_step .dependOn (& exe .step );
151+ test_step .dependOn (& exe .step );
153152 }
154153
155154 b .default_step .dependOn (& exe .step );
@@ -415,7 +414,7 @@ pub fn build(b: *Builder) !void {
415414 const test_cases_step = b .step ("test-cases" , "Run the main compiler test cases" );
416415 test_cases_step .dependOn (& test_cases .step );
417416 if (! skip_stage2_tests ) {
418- toolchain_step .dependOn (test_cases_step );
417+ test_step .dependOn (test_cases_step );
419418 }
420419
421420 var chosen_modes : [4 ]builtin.Mode = undefined ;
@@ -439,11 +438,11 @@ pub fn build(b: *Builder) !void {
439438 const modes = chosen_modes [0.. chosen_mode_index ];
440439
441440 // run stage1 `zig fmt` on this build.zig file just to make sure it works
442- toolchain_step .dependOn (& fmt_build_zig .step );
441+ test_step .dependOn (& fmt_build_zig .step );
443442 const fmt_step = b .step ("test-fmt" , "Run zig fmt against build.zig to make sure it works" );
444443 fmt_step .dependOn (& fmt_build_zig .step );
445444
446- toolchain_step .dependOn (tests .addPkgTests (
445+ test_step .dependOn (tests .addPkgTests (
447446 b ,
448447 test_filter ,
449448 "test/behavior.zig" ,
@@ -454,10 +453,10 @@ pub fn build(b: *Builder) !void {
454453 skip_non_native ,
455454 skip_libc ,
456455 skip_stage1 ,
457- false ,
456+ skip_stage2_tests ,
458457 ));
459458
460- toolchain_step .dependOn (tests .addPkgTests (
459+ test_step .dependOn (tests .addPkgTests (
461460 b ,
462461 test_filter ,
463462 "lib/compiler_rt.zig" ,
@@ -468,10 +467,10 @@ pub fn build(b: *Builder) !void {
468467 skip_non_native ,
469468 true , // skip_libc
470469 skip_stage1 ,
471- true , // TODO get these all passing
470+ skip_stage2_tests or true , // TODO get these all passing
472471 ));
473472
474- toolchain_step .dependOn (tests .addPkgTests (
473+ test_step .dependOn (tests .addPkgTests (
475474 b ,
476475 test_filter ,
477476 "lib/c.zig" ,
@@ -482,35 +481,36 @@ pub fn build(b: *Builder) !void {
482481 skip_non_native ,
483482 true , // skip_libc
484483 skip_stage1 ,
485- true , // TODO get these all passing
484+ skip_stage2_tests or true , // TODO get these all passing
486485 ));
487486
488- toolchain_step .dependOn (tests .addCompareOutputTests (b , test_filter , modes ));
489- toolchain_step .dependOn (tests .addStandaloneTests (
487+ test_step .dependOn (tests .addCompareOutputTests (b , test_filter , modes ));
488+ test_step .dependOn (tests .addStandaloneTests (
490489 b ,
491490 test_filter ,
492491 modes ,
493492 skip_non_native ,
494493 enable_macos_sdk ,
495494 target ,
495+ skip_stage2_tests ,
496496 b .enable_darling ,
497497 b .enable_qemu ,
498498 b .enable_rosetta ,
499499 b .enable_wasmtime ,
500500 b .enable_wine ,
501501 ));
502- toolchain_step .dependOn (tests .addLinkTests (b , test_filter , modes , enable_macos_sdk ));
503- toolchain_step .dependOn (tests .addStackTraceTests (b , test_filter , modes ));
504- toolchain_step .dependOn (tests .addCliTests (b , test_filter , modes ));
505- toolchain_step .dependOn (tests .addAssembleAndLinkTests (b , test_filter , modes ));
506- toolchain_step .dependOn (tests .addTranslateCTests (b , test_filter ));
502+ test_step .dependOn (tests .addLinkTests (b , test_filter , modes , enable_macos_sdk , skip_stage2_tests ));
503+ test_step .dependOn (tests .addStackTraceTests (b , test_filter , modes ));
504+ test_step .dependOn (tests .addCliTests (b , test_filter , modes ));
505+ test_step .dependOn (tests .addAssembleAndLinkTests (b , test_filter , modes ));
506+ test_step .dependOn (tests .addTranslateCTests (b , test_filter ));
507507 if (! skip_run_translated_c ) {
508- toolchain_step .dependOn (tests .addRunTranslatedCTests (b , test_filter , target ));
508+ test_step .dependOn (tests .addRunTranslatedCTests (b , test_filter , target ));
509509 }
510510 // tests for this feature are disabled until we have the self-hosted compiler available
511- // toolchain_step .dependOn(tests.addGenHTests(b, test_filter));
511+ // test_step .dependOn(tests.addGenHTests(b, test_filter));
512512
513- const std_step = tests .addPkgTests (
513+ test_step . dependOn ( tests .addPkgTests (
514514 b ,
515515 test_filter ,
516516 "lib/std/std.zig" ,
@@ -522,11 +522,7 @@ pub fn build(b: *Builder) !void {
522522 skip_libc ,
523523 skip_stage1 ,
524524 true , // TODO get these all passing
525- );
526-
527- const test_step = b .step ("test" , "Run all the tests" );
528- test_step .dependOn (toolchain_step );
529- test_step .dependOn (std_step );
525+ ));
530526}
531527
532528const exe_cflags = [_ ][]const u8 {
0 commit comments