Skip to content

Commit c4c62a5

Browse files
committed
Rename inputs to common_inputs_stamp
The new name makes it clearer that this is a timestamp, and is collected from input files considered common to all tests.
1 parent 932e9f0 commit c4c62a5

File tree

1 file changed

+13
-7
lines changed
  • src/tools/compiletest/src

1 file changed

+13
-7
lines changed

src/tools/compiletest/src/lib.rs

+13-7
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
547547
struct TestCollectorCx {
548548
config: Arc<Config>,
549549
cache: HeadersCache,
550-
inputs: Stamp,
550+
common_inputs_stamp: Stamp,
551551
modified_tests: Vec<PathBuf>,
552552
}
553553

@@ -565,13 +565,13 @@ struct TestCollector {
565565
/// because filtering is handled later by libtest.
566566
pub fn collect_and_make_tests(config: Arc<Config>) -> Vec<test::TestDescAndFn> {
567567
debug!("making tests from {:?}", config.src_base.display());
568-
let inputs = common_inputs_stamp(&config);
568+
let common_inputs_stamp = common_inputs_stamp(&config);
569569
let modified_tests = modified_tests(&config, &config.src_base).unwrap_or_else(|err| {
570570
panic!("modified_tests got error from dir: {}, error: {}", config.src_base.display(), err)
571571
});
572572
let cache = HeadersCache::load(&config);
573573

574-
let cx = TestCollectorCx { config, cache, inputs, modified_tests };
574+
let cx = TestCollectorCx { config, cache, common_inputs_stamp, modified_tests };
575575
let mut collector =
576576
TestCollector { tests: vec![], found_paths: HashSet::new(), poisoned: false };
577577

@@ -592,7 +592,13 @@ pub fn collect_and_make_tests(config: Arc<Config>) -> Vec<test::TestDescAndFn> {
592592
tests
593593
}
594594

595-
/// Returns a stamp constructed from input files common to all test cases.
595+
/// Returns the most recent last-modified timestamp from among the input files
596+
/// that are considered relevant to all tests (e.g. the compiler, std, and
597+
/// compiletest itself).
598+
///
599+
/// (Some of these inputs aren't actually relevant to _all_ tests, but they are
600+
/// common to some subset of tests, and are hopefully unlikely to be modified
601+
/// while working on other tests.)
596602
fn common_inputs_stamp(config: &Config) -> Stamp {
597603
let rust_src_dir = config.find_rust_src_root().expect("Could not find Rust source root");
598604

@@ -902,14 +908,14 @@ fn is_up_to_date(
902908

903909
// Check the timestamp of the stamp file against the last modified time
904910
// of all files known to be relevant to the test.
905-
let mut inputs = cx.inputs.clone();
911+
let mut inputs_stamp = cx.common_inputs_stamp.clone();
906912
for path in files_related_to_test(&cx.config, testpaths, props, revision) {
907-
inputs.add_path(&path);
913+
inputs_stamp.add_path(&path);
908914
}
909915

910916
// If no relevant files have been modified since the stamp file was last
911917
// written, the test is up-to-date.
912-
inputs < Stamp::from_path(&stamp_name)
918+
inputs_stamp < Stamp::from_path(&stamp_name)
913919
}
914920

915921
/// The maximum of a set of file-modified timestamps.

0 commit comments

Comments
 (0)