@@ -25,7 +25,7 @@ use build_helper::git::{get_git_modified_files, get_git_untracked_files};
2525use core:: panic;
2626use getopts:: Options ;
2727use lazycell:: AtomicLazyCell ;
28- use std:: collections:: BTreeSet ;
28+ use std:: collections:: HashSet ;
2929use std:: ffi:: OsString ;
3030use std:: fs;
3131use std:: io:: { self , ErrorKind } ;
@@ -415,7 +415,7 @@ pub fn run_tests(config: Arc<Config>) {
415415
416416 let mut tests = Vec :: new ( ) ;
417417 for c in configs {
418- let mut found_paths = BTreeSet :: new ( ) ;
418+ let mut found_paths = HashSet :: new ( ) ;
419419 make_tests ( c, & mut tests, & mut found_paths) ;
420420 check_overlapping_tests ( & found_paths) ;
421421 }
@@ -550,7 +550,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
550550pub fn make_tests (
551551 config : Arc < Config > ,
552552 tests : & mut Vec < test:: TestDescAndFn > ,
553- found_paths : & mut BTreeSet < PathBuf > ,
553+ found_paths : & mut HashSet < PathBuf > ,
554554) {
555555 debug ! ( "making tests from {:?}" , config. src_base. display( ) ) ;
556556 let inputs = common_inputs_stamp ( & config) ;
@@ -646,7 +646,7 @@ fn collect_tests_from_dir(
646646 relative_dir_path : & Path ,
647647 inputs : & Stamp ,
648648 tests : & mut Vec < test:: TestDescAndFn > ,
649- found_paths : & mut BTreeSet < PathBuf > ,
649+ found_paths : & mut HashSet < PathBuf > ,
650650 modified_tests : & Vec < PathBuf > ,
651651 poisoned : & mut bool ,
652652) -> io:: Result < ( ) > {
@@ -675,6 +675,8 @@ fn collect_tests_from_dir(
675675
676676 // Add each `.rs` file as a test, and recurse further on any
677677 // subdirectories we find, except for `aux` directories.
678+ // FIXME: this walks full tests tree, even if we have something to ignore
679+ // use walkdir/ignore like in tidy?
678680 for file in fs:: read_dir ( dir) ? {
679681 let file = file?;
680682 let file_path = file. path ( ) ;
@@ -1128,7 +1130,7 @@ fn not_a_digit(c: char) -> bool {
11281130 !c. is_digit ( 10 )
11291131}
11301132
1131- fn check_overlapping_tests ( found_paths : & BTreeSet < PathBuf > ) {
1133+ fn check_overlapping_tests ( found_paths : & HashSet < PathBuf > ) {
11321134 let mut collisions = Vec :: new ( ) ;
11331135 for path in found_paths {
11341136 for ancestor in path. ancestors ( ) . skip ( 1 ) {
@@ -1138,6 +1140,7 @@ fn check_overlapping_tests(found_paths: &BTreeSet<PathBuf>) {
11381140 }
11391141 }
11401142 if !collisions. is_empty ( ) {
1143+ collisions. sort ( ) ;
11411144 let collisions: String = collisions
11421145 . into_iter ( )
11431146 . map ( |( path, check_parent) | format ! ( "test {path:?} clashes with {check_parent:?}\n " ) )
0 commit comments