Skip to content

Commit

Permalink
Rename stamp to stamp_file_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Oct 18, 2024
1 parent 3f8d87b commit 5540976
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ fn make_test(cx: &TestCollectorCx, collector: &mut TestCollector, testpaths: &Te

/// The path of the `stamp` file that gets created or updated whenever a
/// particular test completes successfully.
fn stamp(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> PathBuf {
fn stamp_file_path(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> PathBuf {
output_base_dir(config, testpaths, revision).join("stamp")
}

Expand Down Expand Up @@ -891,9 +891,9 @@ fn is_up_to_date(
props: &EarlyProps,
revision: Option<&str>,
) -> bool {
let stamp_name = stamp(&cx.config, testpaths, revision);
let stamp_file_path = stamp_file_path(&cx.config, testpaths, revision);
// Check the config hash inside the stamp file.
let contents = match fs::read_to_string(&stamp_name) {
let contents = match fs::read_to_string(&stamp_file_path) {
Ok(f) => f,
Err(ref e) if e.kind() == ErrorKind::InvalidData => panic!("Can't read stamp contents"),
// The test hasn't succeeded yet, so it is not up-to-date.
Expand All @@ -915,7 +915,7 @@ fn is_up_to_date(

// If no relevant files have been modified since the stamp file was last
// written, the test is up-to-date.
inputs_stamp < Stamp::from_path(&stamp_name)
inputs_stamp < Stamp::from_path(&stamp_file_path)
}

/// The maximum of a set of file-modified timestamps.
Expand Down
6 changes: 3 additions & 3 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::errors::{self, Error, ErrorKind};
use crate::header::TestProps;
use crate::read2::{Truncated, read2_abbreviated};
use crate::util::{PathBufExt, add_dylib_path, logv, static_regex};
use crate::{ColorConfig, json};
use crate::{ColorConfig, json, stamp_file_path};

mod debugger;

Expand Down Expand Up @@ -2595,8 +2595,8 @@ impl<'test> TestCx<'test> {
}

fn create_stamp(&self) {
let stamp = crate::stamp(&self.config, self.testpaths, self.revision);
fs::write(&stamp, compute_stamp_hash(&self.config)).unwrap();
let stamp_file_path = stamp_file_path(&self.config, self.testpaths, self.revision);
fs::write(&stamp_file_path, compute_stamp_hash(&self.config)).unwrap();
}

fn init_incremental_test(&self) {
Expand Down

0 comments on commit 5540976

Please sign in to comment.