@@ -15,6 +15,7 @@ const stack_size = 32 * 1024 * 1024;
15
15
16
16
pub fn build (b : * Builder ) ! void {
17
17
b .setPreferredReleaseMode (.ReleaseFast );
18
+ const test_step = b .step ("test" , "Run all the tests" );
18
19
const mode = b .standardReleaseOptions ();
19
20
const target = b .standardTargetOptions (.{});
20
21
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 {
39
40
const docs_step = b .step ("docs" , "Build documentation" );
40
41
docs_step .dependOn (& docgen_cmd .step );
41
42
42
- const toolchain_step = b .step ("test-toolchain" , "Run the tests for the toolchain" );
43
-
44
43
var test_cases = b .addTest ("src/test.zig" );
45
44
test_cases .stack_size = stack_size ;
46
45
test_cases .setBuildMode (mode );
@@ -149,7 +148,7 @@ pub fn build(b: *Builder) !void {
149
148
exe .setBuildMode (mode );
150
149
exe .setTarget (target );
151
150
if (! skip_stage2_tests ) {
152
- toolchain_step .dependOn (& exe .step );
151
+ test_step .dependOn (& exe .step );
153
152
}
154
153
155
154
b .default_step .dependOn (& exe .step );
@@ -415,7 +414,7 @@ pub fn build(b: *Builder) !void {
415
414
const test_cases_step = b .step ("test-cases" , "Run the main compiler test cases" );
416
415
test_cases_step .dependOn (& test_cases .step );
417
416
if (! skip_stage2_tests ) {
418
- toolchain_step .dependOn (test_cases_step );
417
+ test_step .dependOn (test_cases_step );
419
418
}
420
419
421
420
var chosen_modes : [4 ]builtin.Mode = undefined ;
@@ -439,11 +438,11 @@ pub fn build(b: *Builder) !void {
439
438
const modes = chosen_modes [0.. chosen_mode_index ];
440
439
441
440
// 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 );
443
442
const fmt_step = b .step ("test-fmt" , "Run zig fmt against build.zig to make sure it works" );
444
443
fmt_step .dependOn (& fmt_build_zig .step );
445
444
446
- toolchain_step .dependOn (tests .addPkgTests (
445
+ test_step .dependOn (tests .addPkgTests (
447
446
b ,
448
447
test_filter ,
449
448
"test/behavior.zig" ,
@@ -454,10 +453,10 @@ pub fn build(b: *Builder) !void {
454
453
skip_non_native ,
455
454
skip_libc ,
456
455
skip_stage1 ,
457
- false ,
456
+ skip_stage2_tests ,
458
457
));
459
458
460
- toolchain_step .dependOn (tests .addPkgTests (
459
+ test_step .dependOn (tests .addPkgTests (
461
460
b ,
462
461
test_filter ,
463
462
"lib/compiler_rt.zig" ,
@@ -468,10 +467,10 @@ pub fn build(b: *Builder) !void {
468
467
skip_non_native ,
469
468
true , // skip_libc
470
469
skip_stage1 ,
471
- true , // TODO get these all passing
470
+ skip_stage2_tests or true , // TODO get these all passing
472
471
));
473
472
474
- toolchain_step .dependOn (tests .addPkgTests (
473
+ test_step .dependOn (tests .addPkgTests (
475
474
b ,
476
475
test_filter ,
477
476
"lib/c.zig" ,
@@ -482,35 +481,36 @@ pub fn build(b: *Builder) !void {
482
481
skip_non_native ,
483
482
true , // skip_libc
484
483
skip_stage1 ,
485
- true , // TODO get these all passing
484
+ skip_stage2_tests or true , // TODO get these all passing
486
485
));
487
486
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 (
490
489
b ,
491
490
test_filter ,
492
491
modes ,
493
492
skip_non_native ,
494
493
enable_macos_sdk ,
495
494
target ,
495
+ skip_stage2_tests ,
496
496
b .enable_darling ,
497
497
b .enable_qemu ,
498
498
b .enable_rosetta ,
499
499
b .enable_wasmtime ,
500
500
b .enable_wine ,
501
501
));
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 ));
507
507
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 ));
509
509
}
510
510
// 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));
512
512
513
- const std_step = tests .addPkgTests (
513
+ test_step . dependOn ( tests .addPkgTests (
514
514
b ,
515
515
test_filter ,
516
516
"lib/std/std.zig" ,
@@ -522,11 +522,7 @@ pub fn build(b: *Builder) !void {
522
522
skip_libc ,
523
523
skip_stage1 ,
524
524
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
+ ));
530
526
}
531
527
532
528
const exe_cflags = [_ ][]const u8 {
0 commit comments