@@ -20,6 +20,7 @@ use crate::dist;
20
20
use crate :: doc:: DocumentationFormat ;
21
21
use crate :: flags:: Subcommand ;
22
22
use crate :: native;
23
+ use crate :: render_tests:: add_flags_and_try_run_tests;
23
24
use crate :: tool:: { self , SourceType , Tool } ;
24
25
use crate :: toolstate:: ToolState ;
25
26
use crate :: util:: { self , add_link_lib_path, dylib_path, dylib_path_var, output, t} ;
@@ -123,7 +124,7 @@ impl Step for CrateJsonDocLint {
123
124
SourceType :: InTree ,
124
125
& [ ] ,
125
126
) ;
126
- try_run ( builder, & mut cargo. into ( ) ) ;
127
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
127
128
}
128
129
}
129
130
@@ -172,7 +173,7 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
172
173
SourceType :: InTree ,
173
174
& [ ] ,
174
175
) ;
175
- try_run ( builder, & mut cargo. into ( ) ) ;
176
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
176
177
177
178
// Build all the default documentation.
178
179
builder. default_doc ( & [ ] ) ;
@@ -333,7 +334,7 @@ impl Step for Cargo {
333
334
334
335
cargo. env ( "PATH" , & path_for_cargo ( builder, compiler) ) ;
335
336
336
- try_run ( builder, & mut cargo. into ( ) ) ;
337
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
337
338
}
338
339
}
339
340
@@ -392,7 +393,7 @@ impl Step for RustAnalyzer {
392
393
cargo. add_rustc_lib_path ( builder, compiler) ;
393
394
cargo. arg ( "--" ) . args ( builder. config . cmd . test_args ( ) ) ;
394
395
395
- builder . run ( & mut cargo. into ( ) ) ;
396
+ add_flags_and_try_run_tests ( builder , & mut cargo. into ( ) ) ;
396
397
}
397
398
}
398
399
@@ -445,7 +446,7 @@ impl Step for Rustfmt {
445
446
446
447
cargo. add_rustc_lib_path ( builder, compiler) ;
447
448
448
- builder . run ( & mut cargo. into ( ) ) ;
449
+ add_flags_and_try_run_tests ( builder , & mut cargo. into ( ) ) ;
449
450
}
450
451
}
451
452
@@ -496,7 +497,7 @@ impl Step for RustDemangler {
496
497
497
498
cargo. add_rustc_lib_path ( builder, compiler) ;
498
499
499
- builder . run ( & mut cargo. into ( ) ) ;
500
+ add_flags_and_try_run_tests ( builder , & mut cargo. into ( ) ) ;
500
501
}
501
502
}
502
503
@@ -637,8 +638,7 @@ impl Step for Miri {
637
638
// Forward test filters.
638
639
cargo. arg ( "--" ) . args ( builder. config . cmd . test_args ( ) ) ;
639
640
640
- let mut cargo = Command :: from ( cargo) ;
641
- builder. run ( & mut cargo) ;
641
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
642
642
643
643
// # Run `cargo miri test`.
644
644
// This is just a smoke test (Miri's own CI invokes this in a bunch of different ways and ensures
@@ -711,7 +711,7 @@ impl Step for CompiletestTest {
711
711
) ;
712
712
cargo. allow_features ( "test" ) ;
713
713
714
- try_run ( builder, & mut cargo. into ( ) ) ;
714
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
715
715
}
716
716
}
717
717
@@ -767,7 +767,7 @@ impl Step for Clippy {
767
767
768
768
cargo. add_rustc_lib_path ( builder, compiler) ;
769
769
770
- if builder . try_run ( & mut cargo. into ( ) ) {
770
+ if add_flags_and_try_run_tests ( builder , & mut cargo. into ( ) ) {
771
771
// The tests succeeded; nothing to do.
772
772
return ;
773
773
}
@@ -1189,7 +1189,7 @@ impl Step for TidySelfTest {
1189
1189
SourceType :: InTree ,
1190
1190
& [ ] ,
1191
1191
) ;
1192
- try_run ( builder, & mut cargo. into ( ) ) ;
1192
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
1193
1193
}
1194
1194
}
1195
1195
@@ -2178,9 +2178,8 @@ impl Step for Crate {
2178
2178
cargo. arg ( "--" ) ;
2179
2179
cargo. args ( & builder. config . cmd . test_args ( ) ) ;
2180
2180
2181
- if !builder. config . verbose_tests {
2182
- cargo. arg ( "--quiet" ) ;
2183
- }
2181
+ cargo. arg ( "-Z" ) . arg ( "unstable-options" ) ;
2182
+ cargo. arg ( "--format" ) . arg ( "json" ) ;
2184
2183
2185
2184
if target. contains ( "emscripten" ) {
2186
2185
cargo. env (
@@ -2208,7 +2207,7 @@ impl Step for Crate {
2208
2207
target
2209
2208
) ) ;
2210
2209
let _time = util:: timeit ( & builder) ;
2211
- try_run ( builder, & mut cargo. into ( ) ) ;
2210
+ crate :: render_tests :: try_run_tests ( builder, & mut cargo. into ( ) ) ;
2212
2211
}
2213
2212
}
2214
2213
@@ -2328,7 +2327,7 @@ impl Step for CrateRustdoc {
2328
2327
) ) ;
2329
2328
let _time = util:: timeit ( & builder) ;
2330
2329
2331
- try_run ( builder, & mut cargo. into ( ) ) ;
2330
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
2332
2331
}
2333
2332
}
2334
2333
@@ -2389,17 +2388,13 @@ impl Step for CrateRustdocJsonTypes {
2389
2388
cargo. arg ( "'-Ctarget-feature=-crt-static'" ) ;
2390
2389
}
2391
2390
2392
- if !builder. config . verbose_tests {
2393
- cargo. arg ( "--quiet" ) ;
2394
- }
2395
-
2396
2391
builder. info ( & format ! (
2397
2392
"{} rustdoc-json-types stage{} ({} -> {})" ,
2398
2393
test_kind, compiler. stage, & compiler. host, target
2399
2394
) ) ;
2400
2395
let _time = util:: timeit ( & builder) ;
2401
2396
2402
- try_run ( builder, & mut cargo. into ( ) ) ;
2397
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
2403
2398
}
2404
2399
}
2405
2400
@@ -2568,7 +2563,7 @@ impl Step for Bootstrap {
2568
2563
// rustbuild tests are racy on directory creation so just run them one at a time.
2569
2564
// Since there's not many this shouldn't be a problem.
2570
2565
cmd. arg ( "--test-threads=1" ) ;
2571
- try_run ( builder, & mut cmd) ;
2566
+ add_flags_and_try_run_tests ( builder, & mut cmd) ;
2572
2567
}
2573
2568
2574
2569
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -2649,7 +2644,7 @@ impl Step for ReplacePlaceholderTest {
2649
2644
SourceType :: InTree ,
2650
2645
& [ ] ,
2651
2646
) ;
2652
- try_run ( builder, & mut cargo. into ( ) ) ;
2647
+ add_flags_and_try_run_tests ( builder, & mut cargo. into ( ) ) ;
2653
2648
}
2654
2649
2655
2650
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
0 commit comments