Skip to content

Commit 17d0d6a

Browse files
Delete executables if the test ran successfully.
This isn't a perfect heuristic, but since the amount of run-fail tests is far lower than run-pass tests for now, it should be sufficient to ensure that we don't run into CI limits. This makes it possible to run the test binary manually (e.g., under gdb/lldb) if it failed to attempt to find out why.
1 parent 8088e20 commit 17d0d6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/tools/compiletest/src/runtest.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1312,9 +1312,11 @@ impl<'test> TestCx<'test> {
13121312
}
13131313
};
13141314

1315-
// delete the executable after running it to save space.
1316-
// it is ok if the deletion failed.
1317-
let _ = fs::remove_file(self.make_exe_name());
1315+
if proc_res.status.success() {
1316+
// delete the executable after running it to save space.
1317+
// it is ok if the deletion failed.
1318+
let _ = fs::remove_file(self.make_exe_name());
1319+
}
13181320

13191321
proc_res
13201322
}

0 commit comments

Comments
 (0)