@@ -58,6 +58,17 @@ impl fmt::Display for TestKind {
58
58
}
59
59
}
60
60
61
+ fn try_run ( build : & Build , cmd : & mut Command ) {
62
+ if build. flags . cmd . no_fail_fast ( ) {
63
+ if !build. try_run ( cmd) {
64
+ let failures = build. delayed_failures . get ( ) ;
65
+ build. delayed_failures . set ( failures + 1 ) ;
66
+ }
67
+ } else {
68
+ build. run ( cmd) ;
69
+ }
70
+ }
71
+
61
72
/// Runs the `linkchecker` tool as compiled in `stage` by the `host` compiler.
62
73
///
63
74
/// This tool in `src/tools` will verify the validity of all our links in the
@@ -67,8 +78,8 @@ pub fn linkcheck(build: &Build, host: &str) {
67
78
let compiler = Compiler :: new ( 0 , host) ;
68
79
69
80
let _time = util:: timeit ( ) ;
70
- build . run ( build. tool_cmd ( & compiler, "linkchecker" )
71
- . arg ( build. out . join ( host) . join ( "doc" ) ) ) ;
81
+ try_run ( build , build. tool_cmd ( & compiler, "linkchecker" )
82
+ . arg ( build. out . join ( host) . join ( "doc" ) ) ) ;
72
83
}
73
84
74
85
/// Runs the `cargotest` tool as compiled in `stage` by the `host` compiler.
@@ -87,10 +98,10 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
87
98
let _time = util:: timeit ( ) ;
88
99
let mut cmd = Command :: new ( build. tool ( & Compiler :: new ( 0 , host) , "cargotest" ) ) ;
89
100
build. prepare_tool_cmd ( compiler, & mut cmd) ;
90
- build . run ( cmd. arg ( & build. cargo )
91
- . arg ( & out_dir)
92
- . env ( "RUSTC" , build. compiler_path ( compiler) )
93
- . env ( "RUSTDOC" , build. rustdoc ( compiler) ) )
101
+ try_run ( build , cmd. arg ( & build. cargo )
102
+ . arg ( & out_dir)
103
+ . env ( "RUSTC" , build. compiler_path ( compiler) )
104
+ . env ( "RUSTDOC" , build. rustdoc ( compiler) ) ) ;
94
105
}
95
106
96
107
/// Runs `cargo test` for `cargo` packaged with Rust.
@@ -107,6 +118,9 @@ pub fn cargo(build: &Build, stage: u32, host: &str) {
107
118
108
119
let mut cargo = build. cargo ( compiler, Mode :: Tool , host, "test" ) ;
109
120
cargo. arg ( "--manifest-path" ) . arg ( build. src . join ( "src/tools/cargo/Cargo.toml" ) ) ;
121
+ if build. flags . cmd . no_fail_fast ( ) {
122
+ cargo. arg ( "--no-fail-fast" ) ;
123
+ }
110
124
111
125
// Don't build tests dynamically, just a pain to work with
112
126
cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
@@ -115,7 +129,7 @@ pub fn cargo(build: &Build, stage: u32, host: &str) {
115
129
// available.
116
130
cargo. env ( "CFG_DISABLE_CROSS_TESTS" , "1" ) ;
117
131
118
- build . run ( cargo. env ( "PATH" , newpath) ) ;
132
+ try_run ( build , cargo. env ( "PATH" , newpath) ) ;
119
133
}
120
134
121
135
/// Runs the `tidy` tool as compiled in `stage` by the `host` compiler.
@@ -131,7 +145,7 @@ pub fn tidy(build: &Build, host: &str) {
131
145
if !build. config . vendor {
132
146
cmd. arg ( "--no-vendor" ) ;
133
147
}
134
- build . run ( & mut cmd) ;
148
+ try_run ( build , & mut cmd) ;
135
149
}
136
150
137
151
fn testdir ( build : & Build , host : & str ) -> PathBuf {
@@ -279,7 +293,7 @@ pub fn compiletest(build: &Build,
279
293
}
280
294
281
295
let _time = util:: timeit ( ) ;
282
- build . run ( & mut cmd) ;
296
+ try_run ( build , & mut cmd) ;
283
297
}
284
298
285
299
/// Run `rustdoc --test` for all documentation in `src/doc`.
@@ -355,7 +369,7 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
355
369
}
356
370
cmd. arg ( "--test-args" ) . arg ( test_args) ;
357
371
358
- build . run ( & mut cmd) ;
372
+ try_run ( build , & mut cmd) ;
359
373
}
360
374
361
375
/// Run all unit tests plus documentation tests for an entire crate DAG defined
@@ -406,6 +420,9 @@ pub fn krate(build: &Build,
406
420
cargo. arg ( "--manifest-path" )
407
421
. arg ( build. src . join ( path) . join ( "Cargo.toml" ) )
408
422
. arg ( "--features" ) . arg ( features) ;
423
+ if test_kind. subcommand ( ) == "test" && build. flags . cmd . no_fail_fast ( ) {
424
+ cargo. arg ( "--no-fail-fast" ) ;
425
+ }
409
426
410
427
match krate {
411
428
Some ( krate) => {
@@ -465,7 +482,7 @@ pub fn krate(build: &Build,
465
482
krate_remote ( build, & compiler, target, mode) ;
466
483
} else {
467
484
cargo. args ( & build. flags . cmd . test_args ( ) ) ;
468
- build . run ( & mut cargo) ;
485
+ try_run ( build , & mut cargo) ;
469
486
}
470
487
}
471
488
@@ -486,7 +503,7 @@ fn krate_emscripten(build: &Build,
486
503
if build. config . quiet_tests {
487
504
cmd. arg ( "--quiet" ) ;
488
505
}
489
- build . run ( & mut cmd) ;
506
+ try_run ( build , & mut cmd) ;
490
507
}
491
508
}
492
509
@@ -508,7 +525,7 @@ fn krate_remote(build: &Build,
508
525
cmd. arg ( "--quiet" ) ;
509
526
}
510
527
cmd. args ( & build. flags . cmd . test_args ( ) ) ;
511
- build . run ( & mut cmd) ;
528
+ try_run ( build , & mut cmd) ;
512
529
}
513
530
}
514
531
@@ -624,6 +641,9 @@ pub fn bootstrap(build: &Build) {
624
641
. current_dir ( build. src . join ( "src/bootstrap" ) )
625
642
. env ( "CARGO_TARGET_DIR" , build. out . join ( "bootstrap" ) )
626
643
. env ( "RUSTC" , & build. rustc ) ;
644
+ if build. flags . cmd . no_fail_fast ( ) {
645
+ cmd. arg ( "--no-fail-fast" ) ;
646
+ }
627
647
cmd. arg ( "--" ) . args ( & build. flags . cmd . test_args ( ) ) ;
628
- build . run ( & mut cmd) ;
648
+ try_run ( build , & mut cmd) ;
629
649
}
0 commit comments