Skip to content

Commit c9fb74e

Browse files
committed
check if x test tests missing any test directory
Signed-off-by: onur-ozkan <[email protected]>
1 parent cf77474 commit c9fb74e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/bootstrap/src/core/builder/tests.rs

+20
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,26 @@ fn validate_path_remap() {
128128
});
129129
}
130130

131+
#[test]
132+
fn check_missing_paths_for_x_test_tests() {
133+
let build = Build::new(configure("test", &["A-A"], &["A-A"]));
134+
135+
let (_, tests_remap_paths) =
136+
PATH_REMAP.iter().find(|(target_path, _)| *target_path == "tests").unwrap();
137+
138+
let tests_dir = fs::read_dir(build.src.join("tests")).unwrap();
139+
for dir in tests_dir {
140+
let path = dir.unwrap().path();
141+
142+
// Skip if not a test directory.
143+
if path.ends_with("tests/auxiliary") || !path.is_dir() {
144+
continue
145+
}
146+
147+
assert!(tests_remap_paths.iter().any(|item| path.ends_with(*item)), "{} is missing in PATH_REMAP tests list.", path.display());
148+
}
149+
}
150+
131151
#[test]
132152
fn test_exclude() {
133153
let mut config = configure("test", &["A-A"], &["A-A"]);

0 commit comments

Comments
 (0)