Skip to content

Commit 66ee33a

Browse files
committed
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 0bb8935 commit 66ee33a

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
@@ -1343,7 +1343,7 @@ impl<'test> TestCx<'test> {
13431343
fn exec_compiled_test(&self) -> ProcRes {
13441344
let env = &self.props.exec_env;
13451345

1346-
match &*self.config.target {
1346+
let proc_res = match &*self.config.target {
13471347
// This is pretty similar to below, we're transforming:
13481348
//
13491349
// program arg1 arg2
@@ -1398,7 +1398,13 @@ impl<'test> TestCx<'test> {
13981398
None,
13991399
)
14001400
}
1401-
}
1401+
};
1402+
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());
1406+
1407+
proc_res
14021408
}
14031409

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

0 commit comments

Comments
 (0)