compiletest: Delete the executable immediately after running.

This should save a lot of space on musl test cases (whose standard library
are linked statically).
This commit is contained in:
kennytm 2018-02-12 03:04:43 +08:00
parent 0bb8935136
commit 66ee33a437
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C
1 changed files with 8 additions and 2 deletions

View File

@ -1343,7 +1343,7 @@ impl<'test> TestCx<'test> {
fn exec_compiled_test(&self) -> ProcRes {
let env = &self.props.exec_env;
match &*self.config.target {
let proc_res = match &*self.config.target {
// This is pretty similar to below, we're transforming:
//
// program arg1 arg2
@ -1398,7 +1398,13 @@ impl<'test> TestCx<'test> {
None,
)
}
}
};
// 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
}
/// For each `aux-build: foo/bar` annotation, we check to find the