@@ -25,7 +25,7 @@ use build_helper::git::{get_git_modified_files, get_git_untracked_files};
25
25
use core:: panic;
26
26
use getopts:: Options ;
27
27
use lazycell:: AtomicLazyCell ;
28
- use std:: collections:: BTreeSet ;
28
+ use std:: collections:: HashSet ;
29
29
use std:: ffi:: OsString ;
30
30
use std:: fs;
31
31
use std:: io:: { self , ErrorKind } ;
@@ -415,7 +415,7 @@ pub fn run_tests(config: Arc<Config>) {
415
415
416
416
let mut tests = Vec :: new ( ) ;
417
417
for c in configs {
418
- let mut found_paths = BTreeSet :: new ( ) ;
418
+ let mut found_paths = HashSet :: new ( ) ;
419
419
make_tests ( c, & mut tests, & mut found_paths) ;
420
420
check_overlapping_tests ( & found_paths) ;
421
421
}
@@ -550,7 +550,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
550
550
pub fn make_tests (
551
551
config : Arc < Config > ,
552
552
tests : & mut Vec < test:: TestDescAndFn > ,
553
- found_paths : & mut BTreeSet < PathBuf > ,
553
+ found_paths : & mut HashSet < PathBuf > ,
554
554
) {
555
555
debug ! ( "making tests from {:?}" , config. src_base. display( ) ) ;
556
556
let inputs = common_inputs_stamp ( & config) ;
@@ -646,7 +646,7 @@ fn collect_tests_from_dir(
646
646
relative_dir_path : & Path ,
647
647
inputs : & Stamp ,
648
648
tests : & mut Vec < test:: TestDescAndFn > ,
649
- found_paths : & mut BTreeSet < PathBuf > ,
649
+ found_paths : & mut HashSet < PathBuf > ,
650
650
modified_tests : & Vec < PathBuf > ,
651
651
poisoned : & mut bool ,
652
652
) -> io:: Result < ( ) > {
@@ -675,6 +675,8 @@ fn collect_tests_from_dir(
675
675
676
676
// Add each `.rs` file as a test, and recurse further on any
677
677
// 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?
678
680
for file in fs:: read_dir ( dir) ? {
679
681
let file = file?;
680
682
let file_path = file. path ( ) ;
@@ -1128,7 +1130,7 @@ fn not_a_digit(c: char) -> bool {
1128
1130
!c. is_digit ( 10 )
1129
1131
}
1130
1132
1131
- fn check_overlapping_tests ( found_paths : & BTreeSet < PathBuf > ) {
1133
+ fn check_overlapping_tests ( found_paths : & HashSet < PathBuf > ) {
1132
1134
let mut collisions = Vec :: new ( ) ;
1133
1135
for path in found_paths {
1134
1136
for ancestor in path. ancestors ( ) . skip ( 1 ) {
@@ -1138,6 +1140,7 @@ fn check_overlapping_tests(found_paths: &BTreeSet<PathBuf>) {
1138
1140
}
1139
1141
}
1140
1142
if !collisions. is_empty ( ) {
1143
+ collisions. sort ( ) ;
1141
1144
let collisions: String = collisions
1142
1145
. into_iter ( )
1143
1146
. map ( |( path, check_parent) | format ! ( "test {path:?} clashes with {check_parent:?}\n " ) )
0 commit comments