@@ -130,7 +130,7 @@ impl PathSet {
130
130
fn has ( & self , needle : & Path ) -> bool {
131
131
match self {
132
132
PathSet :: Set ( set) => set. iter ( ) . any ( |p| p. ends_with ( needle) ) ,
133
- PathSet :: Suite ( _ ) => false ,
133
+ PathSet :: Suite ( suite ) => suite . ends_with ( needle ) ,
134
134
}
135
135
}
136
136
@@ -1849,7 +1849,7 @@ mod __test {
1849
1849
) ;
1850
1850
1851
1851
// Ensure we don't build any compiler artifacts.
1852
- assert ! ( builder. cache. all :: <compile:: Rustc >( ) . is_empty ( ) ) ;
1852
+ assert ! ( ! builder. cache. contains :: <compile:: Rustc >( ) ) ;
1853
1853
assert_eq ! (
1854
1854
first( builder. cache. all:: <test:: Crate >( ) ) ,
1855
1855
& [ test:: Crate {
@@ -1861,4 +1861,34 @@ mod __test {
1861
1861
} , ]
1862
1862
) ;
1863
1863
}
1864
+
1865
+ #[ test]
1866
+ fn test_exclude ( ) {
1867
+ let mut config = configure ( & [ ] , & [ ] ) ;
1868
+ config. exclude = vec ! [
1869
+ "src/test/run-pass" . into( ) ,
1870
+ "src/tools/tidy" . into( ) ,
1871
+ ] ;
1872
+ config. cmd = Subcommand :: Test {
1873
+ paths : Vec :: new ( ) ,
1874
+ test_args : Vec :: new ( ) ,
1875
+ rustc_args : Vec :: new ( ) ,
1876
+ fail_fast : true ,
1877
+ doc_tests : DocTests :: No ,
1878
+ bless : false ,
1879
+ compare_mode : None ,
1880
+ } ;
1881
+
1882
+ let build = Build :: new ( config) ;
1883
+ let builder = Builder :: new ( & build) ;
1884
+ builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Test ) , & [ ] ) ;
1885
+
1886
+ // Ensure we have really excluded run-pass & tidy
1887
+ assert ! ( !builder. cache. contains:: <test:: RunPass >( ) ) ;
1888
+ assert ! ( !builder. cache. contains:: <test:: Tidy >( ) ) ;
1889
+
1890
+ // Ensure other tests are not affected.
1891
+ assert ! ( builder. cache. contains:: <test:: RunPassFullDeps >( ) ) ;
1892
+ assert ! ( builder. cache. contains:: <test:: RustdocUi >( ) ) ;
1893
+ }
1864
1894
}
0 commit comments