Skip to content

Commit cbe7f56

Browse files
nnethercoteMark-Simulacrum
authored andcommitted
Assert that self-profiling files aren't being clobbered.
1 parent e21396c commit cbe7f56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,10 @@ impl<'a> Processor for ProfileProcessor<'a> {
524524
}
525525
fs::rename(&tmp_zsp_dir, &zsp_dir)?;
526526

527-
// Rename the data files.
527+
// Rename the data files. There should be exactly three.
528+
let mut num_files = 0;
528529
for entry in fs::read_dir(&zsp_dir).unwrap() {
530+
num_files += 1;
529531
let filename = entry.unwrap().file_name();
530532
let filename_str = filename.to_str().unwrap();
531533
let path = filepath(&zsp_dir, filename_str);
@@ -539,6 +541,7 @@ impl<'a> Processor for ProfileProcessor<'a> {
539541
panic!("unexpected file {:?}", path);
540542
}
541543
}
544+
assert_eq!(num_files, 3);
542545

543546
// Run `summarize`.
544547
let mut summarize_cmd = Command::new("summarize");

0 commit comments

Comments
 (0)