@@ -25,6 +25,7 @@ use tracing::*;
25
25
use walkdir:: WalkDir ;
26
26
27
27
use self :: header:: { make_test_description, EarlyProps } ;
28
+ use crate :: header:: HeadersCache ;
28
29
use std:: sync:: Arc ;
29
30
30
31
#[ cfg( test) ]
@@ -556,9 +557,11 @@ pub fn make_tests(
556
557
panic ! ( "modified_tests got error from dir: {}, error: {}" , config. src_base. display( ) , err)
557
558
} ) ;
558
559
560
+ let cache = HeadersCache :: load ( & config) ;
559
561
let mut poisoned = false ;
560
562
collect_tests_from_dir (
561
563
config. clone ( ) ,
564
+ & cache,
562
565
& config. src_base ,
563
566
& PathBuf :: new ( ) ,
564
567
& inputs,
@@ -636,6 +639,7 @@ fn modified_tests(config: &Config, dir: &Path) -> Result<Vec<PathBuf>, String> {
636
639
637
640
fn collect_tests_from_dir (
638
641
config : Arc < Config > ,
642
+ cache : & HeadersCache ,
639
643
dir : & Path ,
640
644
relative_dir_path : & Path ,
641
645
inputs : & Stamp ,
@@ -654,7 +658,7 @@ fn collect_tests_from_dir(
654
658
file : dir. to_path_buf ( ) ,
655
659
relative_dir : relative_dir_path. parent ( ) . unwrap ( ) . to_path_buf ( ) ,
656
660
} ;
657
- tests. extend ( make_test ( config, & paths, inputs, poisoned) ) ;
661
+ tests. extend ( make_test ( config, cache , & paths, inputs, poisoned) ) ;
658
662
return Ok ( ( ) ) ;
659
663
}
660
664
@@ -680,13 +684,14 @@ fn collect_tests_from_dir(
680
684
let paths =
681
685
TestPaths { file : file_path, relative_dir : relative_dir_path. to_path_buf ( ) } ;
682
686
683
- tests. extend ( make_test ( config. clone ( ) , & paths, inputs, poisoned) )
687
+ tests. extend ( make_test ( config. clone ( ) , cache , & paths, inputs, poisoned) )
684
688
} else if file_path. is_dir ( ) {
685
689
let relative_file_path = relative_dir_path. join ( file. file_name ( ) ) ;
686
690
if & file_name != "auxiliary" {
687
691
debug ! ( "found directory: {:?}" , file_path. display( ) ) ;
688
692
collect_tests_from_dir (
689
693
config. clone ( ) ,
694
+ cache,
690
695
& file_path,
691
696
& relative_file_path,
692
697
inputs,
@@ -718,6 +723,7 @@ pub fn is_test(file_name: &OsString) -> bool {
718
723
719
724
fn make_test (
720
725
config : Arc < Config > ,
726
+ cache : & HeadersCache ,
721
727
testpaths : & TestPaths ,
722
728
inputs : & Stamp ,
723
729
poisoned : & mut bool ,
@@ -745,8 +751,9 @@ fn make_test(
745
751
std:: fs:: File :: open ( & test_path) . expect ( "open test file to parse ignores" ) ;
746
752
let cfg = revision. map ( |v| & * * v) ;
747
753
let test_name = crate :: make_test_name ( & config, testpaths, revision) ;
748
- let mut desc =
749
- make_test_description ( & config, test_name, & test_path, src_file, cfg, poisoned) ;
754
+ let mut desc = make_test_description (
755
+ & config, cache, test_name, & test_path, src_file, cfg, poisoned,
756
+ ) ;
750
757
// Ignore tests that already run and are up to date with respect to inputs.
751
758
if !config. force_rerun {
752
759
desc. ignore |= is_up_to_date (
0 commit comments