@@ -117,9 +117,8 @@ impl Step for CrateBootstrap {
117
117
SourceType :: InTree ,
118
118
& [ ] ,
119
119
) ;
120
- let _group = builder. msg ( Kind :: Test , compiler. stage , path, compiler. host , bootstrap_host) ;
121
120
let crate_name = path. rsplit_once ( '/' ) . unwrap ( ) . 1 ;
122
- run_cargo_test ( cargo, & [ ] , & [ ] , crate_name, compiler, bootstrap_host, builder) ;
121
+ run_cargo_test ( cargo, & [ ] , & [ ] , crate_name, crate_name , compiler, bootstrap_host, builder) ;
123
122
}
124
123
}
125
124
@@ -159,14 +158,6 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
159
158
let bootstrap_host = builder. config . build ;
160
159
let compiler = builder. compiler ( 0 , bootstrap_host) ;
161
160
162
- let self_test_group = builder. msg (
163
- Kind :: Test ,
164
- compiler. stage ,
165
- "linkchecker self tests" ,
166
- bootstrap_host,
167
- bootstrap_host,
168
- ) ;
169
-
170
161
let cargo = tool:: prepare_tool_cargo (
171
162
builder,
172
163
compiler,
@@ -177,8 +168,16 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
177
168
SourceType :: InTree ,
178
169
& [ ] ,
179
170
) ;
180
- run_cargo_test ( cargo, & [ ] , & [ ] , "linkchecker" , compiler, bootstrap_host, builder) ;
181
- drop ( self_test_group) ;
171
+ run_cargo_test (
172
+ cargo,
173
+ & [ ] ,
174
+ & [ ] ,
175
+ "linkchecker" ,
176
+ "linkchecker self tests" ,
177
+ compiler,
178
+ bootstrap_host,
179
+ builder,
180
+ ) ;
182
181
183
182
if builder. doc_tests == DocTests :: No {
184
183
return ;
@@ -415,8 +414,7 @@ impl Step for RustAnalyzer {
415
414
cargo. env ( "SKIP_SLOW_TESTS" , "1" ) ;
416
415
417
416
cargo. add_rustc_lib_path ( builder, compiler) ;
418
- builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "rust-analyzer" , host, host) ;
419
- run_cargo_test ( cargo, & [ ] , & [ ] , "rust-analyzer" , compiler, host, builder) ;
417
+ run_cargo_test ( cargo, & [ ] , & [ ] , "rust-analyzer" , "rust-analyzer" , compiler, host, builder) ;
420
418
}
421
419
}
422
420
@@ -465,8 +463,7 @@ impl Step for Rustfmt {
465
463
466
464
cargo. add_rustc_lib_path ( builder, compiler) ;
467
465
468
- builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "rustfmt" , host, host) ;
469
- run_cargo_test ( cargo, & [ ] , & [ ] , "rustfmt" , compiler, host, builder) ;
466
+ run_cargo_test ( cargo, & [ ] , & [ ] , "rustfmt" , "rustfmt" , compiler, host, builder) ;
470
467
}
471
468
}
472
469
@@ -514,7 +511,16 @@ impl Step for RustDemangler {
514
511
cargo. env ( "RUST_DEMANGLER_DRIVER_PATH" , rust_demangler) ;
515
512
cargo. add_rustc_lib_path ( builder, compiler) ;
516
513
517
- run_cargo_test ( cargo, & [ ] , & [ ] , "rust-demangler" , compiler, host, builder) ;
514
+ run_cargo_test (
515
+ cargo,
516
+ & [ ] ,
517
+ & [ ] ,
518
+ "rust-demangler" ,
519
+ "rust-demangler" ,
520
+ compiler,
521
+ host,
522
+ builder,
523
+ ) ;
518
524
}
519
525
}
520
526
@@ -756,7 +762,16 @@ impl Step for CompiletestTest {
756
762
& [ ] ,
757
763
) ;
758
764
cargo. allow_features ( "test" ) ;
759
- run_cargo_test ( cargo, & [ ] , & [ ] , "compiletest" , compiler, host, builder) ;
765
+ run_cargo_test (
766
+ cargo,
767
+ & [ ] ,
768
+ & [ ] ,
769
+ "compiletest" ,
770
+ "compiletest self test" ,
771
+ compiler,
772
+ host,
773
+ builder,
774
+ ) ;
760
775
}
761
776
}
762
777
@@ -812,7 +827,7 @@ impl Step for Clippy {
812
827
cargo. env ( "BLESS" , "Gesundheit" ) ;
813
828
}
814
829
815
- builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
830
+ let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
816
831
817
832
if builder. try_run ( & mut cargo) . is_ok ( ) {
818
833
// The tests succeeded; nothing to do.
@@ -2207,18 +2222,22 @@ impl Step for CrateLibrustc {
2207
2222
/// Given a `cargo test` subcommand, add the appropriate flags and run it.
2208
2223
///
2209
2224
/// Returns whether the test succeeded.
2210
- fn run_cargo_test (
2225
+ fn run_cargo_test < ' a > (
2211
2226
cargo : impl Into < Command > ,
2212
2227
libtest_args : & [ & str ] ,
2213
2228
crates : & [ Interned < String > ] ,
2214
2229
primary_crate : & str ,
2230
+ description : impl Into < Option < & ' a str > > ,
2215
2231
compiler : Compiler ,
2216
2232
target : TargetSelection ,
2217
2233
builder : & Builder < ' _ > ,
2218
2234
) -> bool {
2219
2235
let mut cargo =
2220
2236
prepare_cargo_test ( cargo, libtest_args, crates, primary_crate, compiler, target, builder) ;
2221
2237
let _time = util:: timeit ( & builder) ;
2238
+ let _group = description. into ( ) . and_then ( |what| {
2239
+ builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , what, compiler. host , target)
2240
+ } ) ;
2222
2241
2223
2242
#[ cfg( feature = "build-metrics" ) ]
2224
2243
builder. metrics . begin_test_suite (
@@ -2384,14 +2403,16 @@ impl Step for Crate {
2384
2403
_ => panic ! ( "can only test libraries" ) ,
2385
2404
} ;
2386
2405
2387
- let _guard = builder. msg (
2388
- builder. kind ,
2389
- compiler. stage ,
2390
- crate_description ( & self . crates ) ,
2391
- compiler. host ,
2406
+ run_cargo_test (
2407
+ cargo,
2408
+ & [ ] ,
2409
+ & self . crates ,
2410
+ & self . crates [ 0 ] ,
2411
+ & * crate_description ( & self . crates ) ,
2412
+ compiler,
2392
2413
target,
2414
+ builder,
2393
2415
) ;
2394
- run_cargo_test ( cargo, & [ ] , & self . crates , & self . crates [ 0 ] , compiler, target, builder) ;
2395
2416
}
2396
2417
}
2397
2418
@@ -2484,18 +2505,12 @@ impl Step for CrateRustdoc {
2484
2505
dylib_path. insert ( 0 , PathBuf :: from ( & * libdir) ) ;
2485
2506
cargo. env ( dylib_path_var ( ) , env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
2486
2507
2487
- let _guard = builder. msg_sysroot_tool (
2488
- builder. kind ,
2489
- compiler. stage ,
2490
- "rustdoc" ,
2491
- compiler. host ,
2492
- target,
2493
- ) ;
2494
2508
run_cargo_test (
2495
2509
cargo,
2496
2510
& [ ] ,
2497
2511
& [ INTERNER . intern_str ( "rustdoc:0.0.0" ) ] ,
2498
2512
"rustdoc" ,
2513
+ "rustdoc" ,
2499
2514
compiler,
2500
2515
target,
2501
2516
builder,
@@ -2551,13 +2566,12 @@ impl Step for CrateRustdocJsonTypes {
2551
2566
& [ ]
2552
2567
} ;
2553
2568
2554
- let _guard =
2555
- builder. msg ( builder. kind , compiler. stage , "rustdoc-json-types" , compiler. host , target) ;
2556
2569
run_cargo_test (
2557
2570
cargo,
2558
2571
libtest_args,
2559
2572
& [ INTERNER . intern_str ( "rustdoc-json-types" ) ] ,
2560
2573
"rustdoc-json-types" ,
2574
+ "rustdoc-json-types" ,
2561
2575
compiler,
2562
2576
target,
2563
2577
builder,
@@ -2728,7 +2742,7 @@ impl Step for Bootstrap {
2728
2742
}
2729
2743
// rustbuild tests are racy on directory creation so just run them one at a time.
2730
2744
// Since there's not many this shouldn't be a problem.
2731
- run_cargo_test ( cmd, & [ "--test-threads=1" ] , & [ ] , "bootstrap" , compiler, host, builder) ;
2745
+ run_cargo_test ( cmd, & [ "--test-threads=1" ] , & [ ] , "bootstrap" , None , compiler, host, builder) ;
2732
2746
}
2733
2747
2734
2748
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -2846,14 +2860,16 @@ impl Step for RustInstaller {
2846
2860
& [ ] ,
2847
2861
) ;
2848
2862
2849
- let _guard = builder. msg (
2850
- Kind :: Test ,
2851
- compiler. stage ,
2863
+ run_cargo_test (
2864
+ cargo,
2865
+ & [ ] ,
2866
+ & [ ] ,
2867
+ "installer" ,
2852
2868
"rust-installer" ,
2869
+ compiler,
2853
2870
bootstrap_host,
2854
- bootstrap_host ,
2871
+ builder ,
2855
2872
) ;
2856
- run_cargo_test ( cargo, & [ ] , & [ ] , "installer" , compiler, bootstrap_host, builder) ;
2857
2873
2858
2874
// We currently don't support running the test.sh script outside linux(?) environments.
2859
2875
// Eventually this should likely migrate to #[test]s in rust-installer proper rather than a
0 commit comments