changeset 8433:87346100d7a5

temporary file is removed when unittests fail
author Doug Simon <doug.simon@oracle.com>
date Thu, 21 Mar 2013 15:36:31 +0100
parents 8ed80723c13b
children a444497c48a9
files mx/commands.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mx/commands.py	Thu Mar 21 14:38:35 2013 +0100
+++ b/mx/commands.py	Thu Mar 21 15:36:31 2013 +0100
@@ -761,8 +761,10 @@
         prefixArgs = ['-XX:-BootstrapGraal', '-esa', '-ea']
         vm(prefixArgs + vmArgs + ['-cp', projectscp + ':' + mxdir, name] + [testfile])
 
-    _run_tests(args, harness, annotations, testfile)
-    os.remove(testfile)
+    try:
+        _run_tests(args, harness, annotations, testfile)
+    finally:
+        os.remove(testfile)
 
 def unittest(args):
     """run the JUnit tests (all testcases)