@@ -464,9 +464,7 @@ pub fn run_tests(config: Arc<Config>) {
464
464
// structure for each test (or each revision of a multi-revision test).
465
465
let mut tests = Vec :: new ( ) ;
466
466
for c in configs {
467
- let mut found_paths = HashSet :: new ( ) ;
468
- make_tests ( c, & mut tests, & mut found_paths) ;
469
- check_overlapping_tests ( & found_paths) ;
467
+ tests. extend ( collect_and_make_tests ( c) ) ;
470
468
}
471
469
472
470
tests. sort_by ( |a, b| a. desc . name . as_slice ( ) . cmp ( & b. desc . name . as_slice ( ) ) ) ;
@@ -550,27 +548,26 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
550
548
/// This always inspects _all_ test files in the suite (e.g. all 17k+ ui tests),
551
549
/// regardless of whether any filters/tests were specified on the command-line,
552
550
/// because filtering is handled later by libtest.
553
- pub fn make_tests (
554
- config : Arc < Config > ,
555
- tests : & mut Vec < test:: TestDescAndFn > ,
556
- found_paths : & mut HashSet < PathBuf > ,
557
- ) {
551
+ pub fn collect_and_make_tests ( config : Arc < Config > ) -> Vec < test:: TestDescAndFn > {
558
552
debug ! ( "making tests from {:?}" , config. src_base. display( ) ) ;
559
553
let inputs = common_inputs_stamp ( & config) ;
560
554
let modified_tests = modified_tests ( & config, & config. src_base ) . unwrap_or_else ( |err| {
561
555
panic ! ( "modified_tests got error from dir: {}, error: {}" , config. src_base. display( ) , err)
562
556
} ) ;
563
-
564
557
let cache = HeadersCache :: load ( & config) ;
558
+
559
+ let mut tests = vec ! [ ] ;
560
+ let mut found_paths = HashSet :: new ( ) ;
565
561
let mut poisoned = false ;
562
+
566
563
collect_tests_from_dir (
567
564
config. clone ( ) ,
568
565
& cache,
569
566
& config. src_base ,
570
567
& PathBuf :: new ( ) ,
571
568
& inputs,
572
- tests,
573
- found_paths,
569
+ & mut tests,
570
+ & mut found_paths,
574
571
& modified_tests,
575
572
& mut poisoned,
576
573
)
@@ -582,6 +579,10 @@ pub fn make_tests(
582
579
eprintln ! ( ) ;
583
580
panic ! ( "there are errors in tests" ) ;
584
581
}
582
+
583
+ check_overlapping_tests ( & found_paths) ;
584
+
585
+ tests
585
586
}
586
587
587
588
/// Returns a stamp constructed from input files common to all test cases.
0 commit comments