@@ -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 ;
@@ -413,8 +412,7 @@ impl Step for RustAnalyzer {
413412 cargo. env ( "SKIP_SLOW_TESTS" , "1" ) ;
414413
415414 cargo. add_rustc_lib_path ( builder, compiler) ;
416- builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "rust-analyzer" , host, host) ;
417- run_cargo_test ( cargo, & [ ] , & [ ] , "rust-analyzer" , compiler, host, builder) ;
415+ run_cargo_test ( cargo, & [ ] , & [ ] , "rust-analyzer" , "rust-analyzer" , compiler, host, builder) ;
418416 }
419417}
420418
@@ -463,8 +461,7 @@ impl Step for Rustfmt {
463461
464462 cargo. add_rustc_lib_path ( builder, compiler) ;
465463
466- builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "rustfmt" , host, host) ;
467- run_cargo_test ( cargo, & [ ] , & [ ] , "rustfmt" , compiler, host, builder) ;
464+ run_cargo_test ( cargo, & [ ] , & [ ] , "rustfmt" , "rustfmt" , compiler, host, builder) ;
468465 }
469466}
470467
@@ -512,7 +509,16 @@ impl Step for RustDemangler {
512509 cargo. env ( "RUST_DEMANGLER_DRIVER_PATH" , rust_demangler) ;
513510 cargo. add_rustc_lib_path ( builder, compiler) ;
514511
515- run_cargo_test ( cargo, & [ ] , & [ ] , "rust-demangler" , compiler, host, builder) ;
512+ run_cargo_test (
513+ cargo,
514+ & [ ] ,
515+ & [ ] ,
516+ "rust-demangler" ,
517+ "rust-demangler" ,
518+ compiler,
519+ host,
520+ builder,
521+ ) ;
516522 }
517523}
518524
@@ -754,7 +760,16 @@ impl Step for CompiletestTest {
754760 & [ ] ,
755761 ) ;
756762 cargo. allow_features ( "test" ) ;
757- run_cargo_test ( cargo, & [ ] , & [ ] , "compiletest" , compiler, host, builder) ;
763+ run_cargo_test (
764+ cargo,
765+ & [ ] ,
766+ & [ ] ,
767+ "compiletest" ,
768+ "compiletest self test" ,
769+ compiler,
770+ host,
771+ builder,
772+ ) ;
758773 }
759774}
760775
@@ -810,7 +825,7 @@ impl Step for Clippy {
810825 cargo. env ( "BLESS" , "Gesundheit" ) ;
811826 }
812827
813- builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
828+ let _guard = builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , "clippy" , host, host) ;
814829
815830 if builder. try_run ( & mut cargo) . is_ok ( ) {
816831 // The tests succeeded; nothing to do.
@@ -2201,18 +2216,22 @@ impl Step for CrateLibrustc {
22012216/// Given a `cargo test` subcommand, add the appropriate flags and run it.
22022217///
22032218/// Returns whether the test succeeded.
2204- fn run_cargo_test (
2219+ fn run_cargo_test < ' a > (
22052220 cargo : impl Into < Command > ,
22062221 libtest_args : & [ & str ] ,
22072222 crates : & [ Interned < String > ] ,
22082223 primary_crate : & str ,
2224+ description : impl Into < Option < & ' a str > > ,
22092225 compiler : Compiler ,
22102226 target : TargetSelection ,
22112227 builder : & Builder < ' _ > ,
22122228) -> bool {
22132229 let mut cargo =
22142230 prepare_cargo_test ( cargo, libtest_args, crates, primary_crate, compiler, target, builder) ;
22152231 let _time = util:: timeit ( & builder) ;
2232+ let _group = description. into ( ) . and_then ( |what| {
2233+ builder. msg_sysroot_tool ( Kind :: Test , compiler. stage , what, compiler. host , target)
2234+ } ) ;
22162235
22172236 #[ cfg( feature = "build-metrics" ) ]
22182237 builder. metrics . begin_test_suite (
@@ -2378,14 +2397,16 @@ impl Step for Crate {
23782397 _ => panic ! ( "can only test libraries" ) ,
23792398 } ;
23802399
2381- let _guard = builder. msg (
2382- builder. kind ,
2383- compiler. stage ,
2384- crate_description ( & self . crates ) ,
2385- compiler. host ,
2400+ run_cargo_test (
2401+ cargo,
2402+ & [ ] ,
2403+ & self . crates ,
2404+ & self . crates [ 0 ] ,
2405+ & * crate_description ( & self . crates ) ,
2406+ compiler,
23862407 target,
2408+ builder,
23872409 ) ;
2388- run_cargo_test ( cargo, & [ ] , & self . crates , & self . crates [ 0 ] , compiler, target, builder) ;
23892410 }
23902411}
23912412
@@ -2478,18 +2499,12 @@ impl Step for CrateRustdoc {
24782499 dylib_path. insert ( 0 , PathBuf :: from ( & * libdir) ) ;
24792500 cargo. env ( dylib_path_var ( ) , env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
24802501
2481- let _guard = builder. msg_sysroot_tool (
2482- builder. kind ,
2483- compiler. stage ,
2484- "rustdoc" ,
2485- compiler. host ,
2486- target,
2487- ) ;
24882502 run_cargo_test (
24892503 cargo,
24902504 & [ ] ,
24912505 & [ INTERNER . intern_str ( "rustdoc:0.0.0" ) ] ,
24922506 "rustdoc" ,
2507+ "rustdoc" ,
24932508 compiler,
24942509 target,
24952510 builder,
@@ -2545,13 +2560,12 @@ impl Step for CrateRustdocJsonTypes {
25452560 & [ ]
25462561 } ;
25472562
2548- let _guard =
2549- builder. msg ( builder. kind , compiler. stage , "rustdoc-json-types" , compiler. host , target) ;
25502563 run_cargo_test (
25512564 cargo,
25522565 libtest_args,
25532566 & [ INTERNER . intern_str ( "rustdoc-json-types" ) ] ,
25542567 "rustdoc-json-types" ,
2568+ "rustdoc-json-types" ,
25552569 compiler,
25562570 target,
25572571 builder,
@@ -2722,7 +2736,7 @@ impl Step for Bootstrap {
27222736 }
27232737 // rustbuild tests are racy on directory creation so just run them one at a time.
27242738 // Since there's not many this shouldn't be a problem.
2725- run_cargo_test ( cmd, & [ "--test-threads=1" ] , & [ ] , "bootstrap" , compiler, host, builder) ;
2739+ run_cargo_test ( cmd, & [ "--test-threads=1" ] , & [ ] , "bootstrap" , None , compiler, host, builder) ;
27262740 }
27272741
27282742 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -2840,14 +2854,16 @@ impl Step for RustInstaller {
28402854 & [ ] ,
28412855 ) ;
28422856
2843- let _guard = builder. msg (
2844- Kind :: Test ,
2845- compiler. stage ,
2857+ run_cargo_test (
2858+ cargo,
2859+ & [ ] ,
2860+ & [ ] ,
2861+ "installer" ,
28462862 "rust-installer" ,
2863+ compiler,
28472864 bootstrap_host,
2848- bootstrap_host ,
2865+ builder ,
28492866 ) ;
2850- run_cargo_test ( cargo, & [ ] , & [ ] , "installer" , compiler, bootstrap_host, builder) ;
28512867
28522868 // We currently don't support running the test.sh script outside linux(?) environments.
28532869 // Eventually this should likely migrate to #[test]s in rust-installer proper rather than a
0 commit comments