Skip to content

Commit b54f27b

Browse files
committed
Auto merge of #48144 - kennytm:reduce-musl-test-size, r=Mark-Simulacrum
Compiletest: delete the compiled program once its test is done. Reduces CI disk usage which prevents #48118 from succeeding.
2 parents b8398d9 + 00bce71 commit b54f27b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tools/compiletest/src/runtest.rs

+9-1
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,15 @@ impl<'test> TestCx<'test> {
13981398
None,
13991399
)
14001400
}
1401+
};
1402+
1403+
if proc_res.status.success() {
1404+
// delete the executable after running it to save space.
1405+
// it is ok if the deletion failed.
1406+
let _ = fs::remove_file(self.make_exe_name());
14011407
}
1408+
1409+
proc_res
14021410
}
14031411

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

0 commit comments

Comments
 (0)