s4-selftest: added a --fail-immediately option to s4 test
authorAndrew Tridgell <tridge@samba.org>
Mon, 27 Sep 2010 01:58:05 +0000 (18:58 -0700)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 28 Sep 2010 07:12:39 +0000 (09:12 +0200)
this can be used to force an immediate test failure on the first
failed test case. You can also use:

  make test FAIL_IMMEDIATELY=1

source4/selftest/wscript

index d07ae0ff353eaac7f51c411f1599c1d10b07d038..58cddb4053f7ce577512fd076ab6adf1fcacbfb3 100644 (file)
@@ -51,6 +51,9 @@ def set_options(opt):
     gr.add_option('--gdbtest',
                   help=("run the testsuite within a gdb xterm window"),
                   action="store_true", dest='GDBTEST', default=False)
+    gr.add_option('--fail-immediately',
+                  help=("stop tests on first failure"),
+                  action="store_true", dest='FAIL_IMMEDIATELY', default=False)
     gr.add_option('--socket-wrapper-pcap',
                   help=("create a pcap file for each failing test"),
                   action="store_true", dest='SOCKET_WRAPPER_PCAP', default=False)
@@ -76,6 +79,10 @@ def cmd_testonly(opt):
 
     env.SUBUNIT_FORMATTER = '${PYTHON} -u ../selftest/format-subunit --prefix=${SELFTEST_PREFIX} --immediate'
     env.FILTER_XFAIL = '${PYTHON} -u ../selftest/filter-subunit --expected-failures=./selftest/knownfail'
+
+    if Options.options.FAIL_IMMEDIATELY:
+        env.FILTER_XFAIL += ' --fail-immediately'
+
     env.FORMAT_TEST_OUTPUT = '${SUBUNIT_FORMATTER}'
 
     env.OPTIONS = ''