@@ -117,9 +117,8 @@ impl Step for CrateBootstrap {
117117 SourceType :: InTree ,
118118 & [ ] ,
119119 ) ;
120- let _group = builder. msg ( Kind :: Test , compiler. stage , path, compiler. host , bootstrap_host) ;
121120 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) ;
123122 }
124123}
125124
@@ -159,14 +158,6 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
159158 let bootstrap_host = builder. config . build ;
160159 let compiler = builder. compiler ( 0 , bootstrap_host) ;
161160
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-
170161 let cargo = tool:: prepare_tool_cargo (
171162 builder,
172163 compiler,
@@ -177,8 +168,16 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
177168 SourceType :: InTree ,
178169 & [ ] ,
179170 ) ;
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+ ) ;
182181
183182 if builder. doc_tests == DocTests :: No {
184183 return ;
@@ -415,8 +414,7 @@ impl Step for RustAnalyzer {
415414 cargo. env ( "SKIP_SLOW_TESTS" , "1" ) ;
416415
417416 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) ;
420418 }
421419}
422420
@@ -465,8 +463,7 @@ impl Step for Rustfmt {
465463
466464 cargo. add_rustc_lib_path ( builder, compiler) ;
467465
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) ;
470467 }
471468}
472469
@@ -514,7 +511,16 @@ impl Step for RustDemangler {
514511 cargo. env ( "RUST_DEMANGLER_DRIVER_PATH" , rust_demangler) ;
515512 cargo. add_rustc_lib_path ( builder, compiler) ;
516513
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+ ) ;
518524 }
519525}
520526
@@ -756,7 +762,16 @@ impl Step for CompiletestTest {
756762 & [ ] ,
757763 ) ;
758764 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+ ) ;
760775 }
761776}
762777
@@ -812,7 +827,7 @@ impl Step for Clippy {
812827 cargo. env ( "BLESS" , "Gesundheit" ) ;
813828 }
814829
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) ;
816831
817832 if builder. try_run ( & mut cargo) . is_ok ( ) {
818833 // The tests succeeded; nothing to do.
@@ -2207,18 +2222,22 @@ impl Step for CrateLibrustc {
22072222/// Given a `cargo test` subcommand, add the appropriate flags and run it.
22082223///
22092224/// Returns whether the test succeeded.
2210- fn run_cargo_test (
2225+ fn run_cargo_test < ' a > (
22112226 cargo : impl Into < Command > ,
22122227 libtest_args : & [ & str ] ,
22132228 crates : & [ Interned < String > ] ,
22142229 primary_crate : & str ,
2230+ description : impl Into < Option < & ' a str > > ,
22152231 compiler : Compiler ,
22162232 target : TargetSelection ,
22172233 builder : & Builder < ' _ > ,
22182234) -> bool {
22192235 let mut cargo =
22202236 prepare_cargo_test ( cargo, libtest_args, crates, primary_crate, compiler, target, builder) ;
22212237 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+ } ) ;
22222241
22232242 #[ cfg( feature = "build-metrics" ) ]
22242243 builder. metrics . begin_test_suite (
@@ -2384,14 +2403,16 @@ impl Step for Crate {
23842403 _ => panic ! ( "can only test libraries" ) ,
23852404 } ;
23862405
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,
23922413 target,
2414+ builder,
23932415 ) ;
2394- run_cargo_test ( cargo, & [ ] , & self . crates , & self . crates [ 0 ] , compiler, target, builder) ;
23952416 }
23962417}
23972418
@@ -2484,18 +2505,12 @@ impl Step for CrateRustdoc {
24842505 dylib_path. insert ( 0 , PathBuf :: from ( & * libdir) ) ;
24852506 cargo. env ( dylib_path_var ( ) , env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
24862507
2487- let _guard = builder. msg_sysroot_tool (
2488- builder. kind ,
2489- compiler. stage ,
2490- "rustdoc" ,
2491- compiler. host ,
2492- target,
2493- ) ;
24942508 run_cargo_test (
24952509 cargo,
24962510 & [ ] ,
24972511 & [ INTERNER . intern_str ( "rustdoc:0.0.0" ) ] ,
24982512 "rustdoc" ,
2513+ "rustdoc" ,
24992514 compiler,
25002515 target,
25012516 builder,
@@ -2551,13 +2566,12 @@ impl Step for CrateRustdocJsonTypes {
25512566 & [ ]
25522567 } ;
25532568
2554- let _guard =
2555- builder. msg ( builder. kind , compiler. stage , "rustdoc-json-types" , compiler. host , target) ;
25562569 run_cargo_test (
25572570 cargo,
25582571 libtest_args,
25592572 & [ INTERNER . intern_str ( "rustdoc-json-types" ) ] ,
25602573 "rustdoc-json-types" ,
2574+ "rustdoc-json-types" ,
25612575 compiler,
25622576 target,
25632577 builder,
@@ -2728,7 +2742,7 @@ impl Step for Bootstrap {
27282742 }
27292743 // rustbuild tests are racy on directory creation so just run them one at a time.
27302744 // 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) ;
27322746 }
27332747
27342748 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -2846,14 +2860,16 @@ impl Step for RustInstaller {
28462860 & [ ] ,
28472861 ) ;
28482862
2849- let _guard = builder. msg (
2850- Kind :: Test ,
2851- compiler. stage ,
2863+ run_cargo_test (
2864+ cargo,
2865+ & [ ] ,
2866+ & [ ] ,
2867+ "installer" ,
28522868 "rust-installer" ,
2869+ compiler,
28532870 bootstrap_host,
2854- bootstrap_host ,
2871+ builder ,
28552872 ) ;
2856- run_cargo_test ( cargo, & [ ] , & [ ] , "installer" , compiler, bootstrap_host, builder) ;
28572873
28582874 // We currently don't support running the test.sh script outside linux(?) environments.
28592875 // Eventually this should likely migrate to #[test]s in rust-installer proper rather than a
0 commit comments