diff mx/mx_graal.py @ 18326:840257b6cdc5

mx: added --fail-fast option to unittest that stops Junit after first input class causing a test failure
author Doug Simon <doug.simon@oracle.com>
date Mon, 10 Nov 2014 18:16:21 +0100
parents 6924bb0badc9
children 13273385abb5
line wrap: on
line diff
--- a/mx/mx_graal.py	Mon Nov 10 18:13:01 2014 +0100
+++ b/mx/mx_graal.py	Mon Nov 10 18:16:21 2014 +0100
@@ -1141,7 +1141,7 @@
         f_testfile.close()
         harness(projectsCp, vmArgs)
 
-def _unittest(args, annotations, prefixCp="", blacklist=None, whitelist=None, verbose=False, enable_timing=False, regex=None, color=False, eager_stacktrace=False, gc_after_test=False):
+def _unittest(args, annotations, prefixCp="", blacklist=None, whitelist=None, verbose=False, fail_fast=False, enable_timing=False, regex=None, color=False, eager_stacktrace=False, gc_after_test=False):
     testfile = os.environ.get('MX_TESTFILE', None)
     if testfile is None:
         (_, testfile) = tempfile.mkstemp(".testclasses", "graal")
@@ -1151,6 +1151,8 @@
     coreArgs = []
     if verbose:
         coreArgs.append('-JUnitVerbose')
+    if fail_fast:
+        coreArgs.append('-JUnitFailFast')
     if enable_timing:
         coreArgs.append('-JUnitEnableTiming')
     if color:
@@ -1206,6 +1208,7 @@
       --whitelist <file>     run only testcases which are included
                              in the given whitelist
       --verbose              enable verbose JUnit output
+      --fail-fast            stop after first JUnit test class that has a failure
       --enable-timing        enable JUnit test timing
       --regex <regex>        run only testcases matching a regular expression
       --color                enable colors output
@@ -1250,6 +1253,7 @@
     parser.add_argument('--blacklist', help='run all testcases not specified in the blacklist', metavar='<path>')
     parser.add_argument('--whitelist', help='run testcases specified in whitelist only', metavar='<path>')
     parser.add_argument('--verbose', help='enable verbose JUnit output', action='store_true')
+    parser.add_argument('--fail-fast', help='stop after first JUnit test class that has a failure', action='store_true')
     parser.add_argument('--enable-timing', help='enable JUnit test timing', action='store_true')
     parser.add_argument('--regex', help='run only testcases matching a regular expression', metavar='<regex>')
     parser.add_argument('--color', help='enable color output', action='store_true')