Skip to content

Commit

Permalink
compiletest: Delete the executable immediately after running.
Browse files Browse the repository at this point in the history
This should save a lot of space on musl test cases (whose standard library
are linked statically).
  • Loading branch information
kennytm committed Feb 11, 2018
1 parent 0bb8935 commit 66ee33a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tools/compiletest/src/runtest.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 66ee33a

Please sign in to comment.