@@ -25,6 +25,7 @@ use tracing::*;
2525use walkdir:: WalkDir ;
2626
2727use self :: header:: { make_test_description, EarlyProps } ;
28+ use crate :: header:: HeadersCache ;
2829use std:: sync:: Arc ;
2930
3031#[ cfg( test) ]
@@ -556,9 +557,11 @@ pub fn make_tests(
556557 panic ! ( "modified_tests got error from dir: {}, error: {}" , config. src_base. display( ) , err)
557558 } ) ;
558559
560+ let cache = HeadersCache :: load ( & config) ;
559561 let mut poisoned = false ;
560562 collect_tests_from_dir (
561563 config. clone ( ) ,
564+ & cache,
562565 & config. src_base ,
563566 & PathBuf :: new ( ) ,
564567 & inputs,
@@ -636,6 +639,7 @@ fn modified_tests(config: &Config, dir: &Path) -> Result<Vec<PathBuf>, String> {
636639
637640fn collect_tests_from_dir (
638641 config : Arc < Config > ,
642+ cache : & HeadersCache ,
639643 dir : & Path ,
640644 relative_dir_path : & Path ,
641645 inputs : & Stamp ,
@@ -654,7 +658,7 @@ fn collect_tests_from_dir(
654658 file : dir. to_path_buf ( ) ,
655659 relative_dir : relative_dir_path. parent ( ) . unwrap ( ) . to_path_buf ( ) ,
656660 } ;
657- tests. extend ( make_test ( config, & paths, inputs, poisoned) ) ;
661+ tests. extend ( make_test ( config, cache , & paths, inputs, poisoned) ) ;
658662 return Ok ( ( ) ) ;
659663 }
660664
@@ -680,13 +684,14 @@ fn collect_tests_from_dir(
680684 let paths =
681685 TestPaths { file : file_path, relative_dir : relative_dir_path. to_path_buf ( ) } ;
682686
683- tests. extend ( make_test ( config. clone ( ) , & paths, inputs, poisoned) )
687+ tests. extend ( make_test ( config. clone ( ) , cache , & paths, inputs, poisoned) )
684688 } else if file_path. is_dir ( ) {
685689 let relative_file_path = relative_dir_path. join ( file. file_name ( ) ) ;
686690 if & file_name != "auxiliary" {
687691 debug ! ( "found directory: {:?}" , file_path. display( ) ) ;
688692 collect_tests_from_dir (
689693 config. clone ( ) ,
694+ cache,
690695 & file_path,
691696 & relative_file_path,
692697 inputs,
@@ -718,6 +723,7 @@ pub fn is_test(file_name: &OsString) -> bool {
718723
719724fn make_test (
720725 config : Arc < Config > ,
726+ cache : & HeadersCache ,
721727 testpaths : & TestPaths ,
722728 inputs : & Stamp ,
723729 poisoned : & mut bool ,
@@ -745,8 +751,9 @@ fn make_test(
745751 std:: fs:: File :: open ( & test_path) . expect ( "open test file to parse ignores" ) ;
746752 let cfg = revision. map ( |v| & * * v) ;
747753 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+ ) ;
750757 // Ignore tests that already run and are up to date with respect to inputs.
751758 if !config. force_rerun {
752759 desc. ignore |= is_up_to_date (
0 commit comments