File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ pub mod pal;
6464pub mod primitive_docs;
6565pub mod style;
6666pub mod target_specific_tests;
67+ pub mod tests_placement;
6768pub mod ui_tests;
6869pub mod unit_tests;
6970pub mod unstable_book;
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ fn main() {
7676 check ! ( extdeps, & root_path) ;
7777
7878 // Checks over tests.
79+ check ! ( tests_placement, & root_path) ;
7980 check ! ( debug_artifacts, & tests_path) ;
8081 check ! ( ui_tests, & tests_path) ;
8182 check ! ( mir_opt_tests, & tests_path, bless) ;
Original file line number Diff line number Diff line change 1+ use std:: path:: Path ;
2+
3+ const FORBIDDEN_PATH : & str = "src/test" ;
4+ const ALLOWED_PATH : & str = "tests" ;
5+
6+ pub fn check ( root_path : impl AsRef < Path > , bad : & mut bool ) {
7+ if root_path. as_ref ( ) . join ( FORBIDDEN_PATH ) . exists ( ) {
8+ tidy_error ! (
9+ bad,
10+ "Tests have been moved, please move them from {} to {}" ,
11+ root_path. as_ref( ) . join( FORBIDDEN_PATH ) . display( ) ,
12+ root_path. as_ref( ) . join( ALLOWED_PATH ) . display( )
13+ )
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments