Skip to content

Commit 00bce71

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 66ee33a commit 00bce71

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
@@ -1400,9 +1400,11 @@ impl<'test> TestCx<'test> {
14001400
}
14011401
};
14021402

1403-
// delete the executable after running it to save space.
1404-
// it is ok if the deletion failed.
1405-
let _ = fs::remove_file(self.make_exe_name());
1403+
if proc_res.status.success() {
1404+
// delete the executable after running it to save space.
1405+
// it is ok if the deletion failed.
1406+
let _ = fs::remove_file(self.make_exe_name());
1407+
}
14061408

14071409
proc_res
14081410
}

0 commit comments

Comments
 (0)