Skip to content

Commit 19dce73

Browse files
committed
Delete non-revision ui test output file if revisions are used
1 parent 5553301 commit 19dce73

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3761,6 +3761,13 @@ impl<'test> TestCx<'test> {
37613761

37623762
let mut files = vec![output_file];
37633763
if self.config.bless {
3764+
// Delete non-revision .stderr/.stdout file if revisions are used.
3765+
// Without this, we'd just generate the new files and leave the old files around.
3766+
if self.revision.is_some() {
3767+
let old =
3768+
expected_output_path(self.testpaths, None, &self.config.compare_mode, kind);
3769+
self.delete_file(&old);
3770+
}
37643771
files.push(expected_output_path(
37653772
self.testpaths,
37663773
self.revision,

0 commit comments

Comments
 (0)