about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2018-02-11 16:27:33 -0700
committerMark Simulacrum <mark.simulacrum@gmail.com>2018-02-11 16:27:33 -0700
commit00bce71144643c7b6c46f9feb6be69de6a61ceed (patch)
treeefceaef964fd6f304e0d1d4333fa9e696cbf0c98 /src/tools
parent66ee33a43730d99409a586a1fd437b320d14f903 (diff)
downloadrust-00bce71144643c7b6c46f9feb6be69de6a61ceed.tar.gz
rust-00bce71144643c7b6c46f9feb6be69de6a61ceed.zip
Delete executables if the test ran successfully.
This isn't a perfect heuristic, but since the amount of run-fail tests
is far lower than run-pass tests for now, it should be sufficient to
ensure that we don't run into CI limits. This makes it possible to run
the test binary manually (e.g., under gdb/lldb) if it failed to attempt
to find out why.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/compiletest/src/runtest.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 940721f1cc1..a87809dd7bc 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1400,9 +1400,11 @@ impl<'test> TestCx<'test> {
             }
         };
 
-        // delete the executable after running it to save space.
-        // it is ok if the deletion failed.
-        let _ = fs::remove_file(self.make_exe_name());
+        if proc_res.status.success() {
+            // 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
     }