@@ -1888,7 +1888,7 @@ mod snapshot {
18881888 [test] Pretty <host>
18891889 [build] rustc 1 <host> -> std 1 <host>
18901890 [build] rustc 0 <host> -> std 0 <host>
1891- [test] CrateLibrustc <host>
1891+ [test] rustc 0 <host> -> CrateLibrustc 1 <host>
18921892 [build] rustc 1 <host> -> rustc 2 <host>
18931893 [test] crate-bootstrap <host> src/tools/coverage-dump
18941894 [test] crate-bootstrap <host> src/tools/jsondoclint
@@ -1938,6 +1938,40 @@ mod snapshot {
19381938 " ) ;
19391939 }
19401940
1941+ #[ test]
1942+ fn test_compiler_stage_1 ( ) {
1943+ let ctx = TestCtx :: new ( ) ;
1944+ insta:: assert_snapshot!(
1945+ ctx. config( "test" )
1946+ . path( "compiler" )
1947+ . stage( 1 )
1948+ . render_steps( ) , @r"
1949+ [build] llvm <host>
1950+ [build] rustc 0 <host> -> rustc 1 <host>
1951+ [build] rustc 0 <host> -> std 0 <host>
1952+ [build] rustdoc 0 <host>
1953+ [test] rustc 0 <host> -> CrateLibrustc 1 <host>
1954+ " ) ;
1955+ }
1956+
1957+ #[ test]
1958+ fn test_compiler_stage_2 ( ) {
1959+ let ctx = TestCtx :: new ( ) ;
1960+ insta:: assert_snapshot!(
1961+ ctx. config( "test" )
1962+ . path( "compiler" )
1963+ . stage( 2 )
1964+ . render_steps( ) , @r"
1965+ [build] llvm <host>
1966+ [build] rustc 0 <host> -> rustc 1 <host>
1967+ [build] rustc 1 <host> -> std 1 <host>
1968+ [build] rustc 1 <host> -> rustc 2 <host>
1969+ [build] rustc 1 <host> -> std 1 <host>
1970+ [build] rustdoc 1 <host>
1971+ [test] rustc 1 <host> -> CrateLibrustc 2 <host>
1972+ " ) ;
1973+ }
1974+
19411975 #[ test]
19421976 fn test_exclude ( ) {
19431977 let ctx = TestCtx :: new ( ) ;
@@ -1955,13 +1989,14 @@ mod snapshot {
19551989
19561990 let get_steps = |args : & [ & str ] | ctx. config ( "test" ) . args ( args) . get_steps ( ) ;
19571991
1992+ let rustc_metadata = || StepMetadata :: test ( "CrateLibrustc" , host) . built_by ( Compiler :: new ( 0 , host) ) ;
19581993 // Ensure our test is valid, and `test::Rustc` would be run without the exclude.
1959- get_steps ( & [ ] ) . assert_contains ( StepMetadata :: test ( "CrateLibrustc" , host ) ) ;
1994+ get_steps ( & [ ] ) . assert_contains ( rustc_metadata ( ) ) ;
19601995
19611996 let steps = get_steps ( & [ "--skip" , "compiler/rustc_data_structures" ] ) ;
19621997
19631998 // Ensure tests for rustc are not skipped.
1964- steps. assert_contains ( StepMetadata :: test ( "CrateLibrustc" , host ) ) ;
1999+ steps. assert_contains ( rustc_metadata ( ) ) ;
19652000 steps. assert_contains_fuzzy ( StepMetadata :: build ( "rustc" , host) ) ;
19662001 }
19672002
0 commit comments