@@ -65,19 +65,21 @@ impl fmt::Display for TestKind {
65
65
}
66
66
}
67
67
68
- fn try_run_expecting ( build : & Build , cmd : & mut Command , expect : BuildExpectation ) {
68
+ fn try_run_expecting ( build : & Build , cmd : & mut Command , expect : BuildExpectation ) -> bool {
69
69
if !build. fail_fast {
70
70
if !build. try_run ( cmd, expect) {
71
71
let mut failures = build. delayed_failures . borrow_mut ( ) ;
72
72
failures. push ( format ! ( "{:?}" , cmd) ) ;
73
+ return false ;
73
74
}
74
75
} else {
75
76
build. run_expecting ( cmd, expect) ;
76
77
}
78
+ true
77
79
}
78
80
79
81
fn try_run ( build : & Build , cmd : & mut Command ) {
80
- try_run_expecting ( build, cmd, BuildExpectation :: None )
82
+ try_run_expecting ( build, cmd, BuildExpectation :: None ) ;
81
83
}
82
84
83
85
fn try_run_quiet ( build : & Build , cmd : & mut Command ) {
@@ -257,11 +259,13 @@ impl Step for Rls {
257
259
258
260
builder. add_rustc_lib_path ( compiler, & mut cargo) ;
259
261
260
- try_run_expecting (
262
+ if try_run_expecting (
261
263
build,
262
264
& mut cargo,
263
265
builder. build . config . toolstate . rls . passes ( ToolState :: Testing ) ,
264
- ) ;
266
+ ) {
267
+ build. save_toolstate ( "rls" , ToolState :: Testing ) ;
268
+ }
265
269
}
266
270
}
267
271
@@ -305,11 +309,13 @@ impl Step for Rustfmt {
305
309
306
310
builder. add_rustc_lib_path ( compiler, & mut cargo) ;
307
311
308
- try_run_expecting (
312
+ if try_run_expecting (
309
313
build,
310
314
& mut cargo,
311
315
builder. build . config . toolstate . rustfmt . passes ( ToolState :: Testing ) ,
312
- ) ;
316
+ ) {
317
+ build. save_toolstate ( "rustfmt" , ToolState :: Testing ) ;
318
+ }
313
319
}
314
320
}
315
321
@@ -354,11 +360,13 @@ impl Step for Miri {
354
360
355
361
builder. add_rustc_lib_path ( compiler, & mut cargo) ;
356
362
357
- try_run_expecting (
363
+ if try_run_expecting (
358
364
build,
359
365
& mut cargo,
360
366
builder. build . config . toolstate . miri . passes ( ToolState :: Testing ) ,
361
- ) ;
367
+ ) {
368
+ build. save_toolstate ( "miri" , ToolState :: Testing ) ;
369
+ }
362
370
} else {
363
371
eprintln ! ( "failed to test miri: could not build" ) ;
364
372
}
@@ -411,11 +419,13 @@ impl Step for Clippy {
411
419
412
420
builder. add_rustc_lib_path ( compiler, & mut cargo) ;
413
421
414
- try_run_expecting (
422
+ if try_run_expecting (
415
423
build,
416
424
& mut cargo,
417
425
builder. build . config . toolstate . clippy . passes ( ToolState :: Testing ) ,
418
- ) ;
426
+ ) {
427
+ build. save_toolstate ( "clippy-driver" , ToolState :: Testing ) ;
428
+ }
419
429
} else {
420
430
eprintln ! ( "failed to test clippy: could not build" ) ;
421
431
}
0 commit comments