Skip to content

Commit

Permalink
Delete executables if the test ran successfully.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mark-Simulacrum committed Feb 11, 2018
1 parent 8088e20 commit 17d0d6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,11 @@ impl<'test> TestCx<'test> {
}
};

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

proc_res
}
Expand Down

0 comments on commit 17d0d6a

Please sign in to comment.