diff options
| author | onur-ozkan <work@onurozkan.dev> | 2024-05-10 16:06:38 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2024-05-10 17:37:43 +0300 |
| commit | c9fb74e08eeadcaa67f60bb7b07120a1e6c5f412 (patch) | |
| tree | f9977d99df5db8f4f36bc2b6699bde7f20367277 /src | |
| parent | cf774742b6029e0c2e00654975c001d192063b5b (diff) | |
| download | rust-c9fb74e08eeadcaa67f60bb7b07120a1e6c5f412.tar.gz rust-c9fb74e08eeadcaa67f60bb7b07120a1e6c5f412.zip | |
check if `x test tests` missing any test directory
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/builder/tests.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 9898d495c02..9710365ef11 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -129,6 +129,26 @@ fn validate_path_remap() { } #[test] +fn check_missing_paths_for_x_test_tests() { + let build = Build::new(configure("test", &["A-A"], &["A-A"])); + + let (_, tests_remap_paths) = + PATH_REMAP.iter().find(|(target_path, _)| *target_path == "tests").unwrap(); + + let tests_dir = fs::read_dir(build.src.join("tests")).unwrap(); + for dir in tests_dir { + let path = dir.unwrap().path(); + + // Skip if not a test directory. + if path.ends_with("tests/auxiliary") || !path.is_dir() { + continue + } + + assert!(tests_remap_paths.iter().any(|item| path.ends_with(*item)), "{} is missing in PATH_REMAP tests list.", path.display()); + } +} + +#[test] fn test_exclude() { let mut config = configure("test", &["A-A"], &["A-A"]); config.skip = vec!["src/tools/tidy".into()]; |
