File tree 3 files changed +17
-0
lines changed
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ pub mod pal;
64
64
pub mod primitive_docs;
65
65
pub mod style;
66
66
pub mod target_specific_tests;
67
+ pub mod tests_placement;
67
68
pub mod ui_tests;
68
69
pub mod unit_tests;
69
70
pub mod unstable_book;
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ fn main() {
76
76
check ! ( extdeps, & root_path) ;
77
77
78
78
// Checks over tests.
79
+ check ! ( tests_placement, & root_path) ;
79
80
check ! ( debug_artifacts, & tests_path) ;
80
81
check ! ( ui_tests, & tests_path) ;
81
82
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