Skip to content

Commit 8088e20

Browse files
kennytmMark-Simulacrum
authored andcommitted
compiletest: Delete the executable immediately after running.
This should save a lot of space on musl test cases (whose standard library are linked statically).
1 parent 3ed7697 commit 8088e20

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/tools/compiletest/src/runtest.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ impl<'test> TestCx<'test> {
12551255
fn exec_compiled_test(&self) -> ProcRes {
12561256
let env = &self.props.exec_env;
12571257

1258-
match &*self.config.target {
1258+
let proc_res = match &*self.config.target {
12591259
// This is pretty similar to below, we're transforming:
12601260
//
12611261
// program arg1 arg2
@@ -1310,7 +1310,13 @@ impl<'test> TestCx<'test> {
13101310
None,
13111311
)
13121312
}
1313-
}
1313+
};
1314+
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());
1318+
1319+
proc_res
13141320
}
13151321

13161322
/// For each `aux-build: foo/bar` annotation, we check to find the

0 commit comments

Comments
 (0)