@@ -665,6 +665,40 @@ fn stamp(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> Path
665
665
output_base_dir ( config, testpaths, revision) . join ( "stamp" )
666
666
}
667
667
668
+ fn files_related_to_test (
669
+ config : & Config ,
670
+ testpaths : & TestPaths ,
671
+ props : & EarlyProps ,
672
+ revision : Option < & str > ,
673
+ ) -> Vec < PathBuf > {
674
+ let mut related = vec ! [ ] ;
675
+
676
+ if testpaths. file . is_dir ( ) {
677
+ // run-make tests use their individual directory
678
+ for entry in WalkDir :: new ( & testpaths. file ) {
679
+ let path = entry. unwrap ( ) . into_path ( ) ;
680
+ if path. is_file ( ) {
681
+ related. push ( path) ;
682
+ }
683
+ }
684
+ } else {
685
+ related. push ( testpaths. file . clone ( ) ) ;
686
+ }
687
+
688
+ for aux in & props. aux {
689
+ let path = testpaths. file . parent ( ) . unwrap ( ) . join ( "auxiliary" ) . join ( aux) ;
690
+ related. push ( path) ;
691
+ }
692
+
693
+ // UI test files.
694
+ for extension in UI_EXTENSIONS {
695
+ let path = expected_output_path ( testpaths, revision, & config. compare_mode , extension) ;
696
+ related. push ( path) ;
697
+ }
698
+
699
+ related
700
+ }
701
+
668
702
fn is_up_to_date (
669
703
config : & Config ,
670
704
testpaths : & TestPaths ,
@@ -686,20 +720,10 @@ fn is_up_to_date(
686
720
687
721
// Check timestamps.
688
722
let mut inputs = inputs. clone ( ) ;
689
- // Use `add_dir` to account for run-make tests, which use their individual directory
690
- inputs. add_dir ( & testpaths. file ) ;
691
-
692
- for aux in & props. aux {
693
- let path = testpaths. file . parent ( ) . unwrap ( ) . join ( "auxiliary" ) . join ( aux) ;
723
+ for path in files_related_to_test ( config, testpaths, props, revision) {
694
724
inputs. add_path ( & path) ;
695
725
}
696
726
697
- // UI test files.
698
- for extension in UI_EXTENSIONS {
699
- let path = & expected_output_path ( testpaths, revision, & config. compare_mode , extension) ;
700
- inputs. add_path ( path) ;
701
- }
702
-
703
727
inputs < Stamp :: from_path ( & stamp_name)
704
728
}
705
729
0 commit comments