selftest: Don't use fancy subunit formatters when generating a test list.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 27 Nov 2011 18:57:53 +0000 (19:57 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 30 Nov 2011 21:58:04 +0000 (22:58 +0100)
selftest/wscript

index b469709a8a7af0bcb6105f24ec9a0473b1927d1d..1509b1a5a43840dc82352933cc2a2dc8264cf145 100644 (file)
@@ -121,8 +121,6 @@ def cmd_testonly(opt):
         env.OPTIONS += ' --socket-wrapper-pcap'
     if Options.options.SOCKET_WRAPPER_KEEP_PCAP:
         env.OPTIONS += ' --socket-wrapper-keep-pcap'
-    if Options.options.LIST:
-        env.OPTIONS += ' --list'
     if os.environ.get('RUN_FROM_BUILD_FARM') is not None:
         env.FILTER_OPTIONS = '${FILTER_XFAIL} --strip-passed-output'
     else:
@@ -176,17 +174,22 @@ def cmd_testonly(opt):
                      '--testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|"')
 
     # We use the full path rather than relative path because it cause problems on some plateforms (ie. solaris 8).
-    cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=samba --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${srcdir}/selftest/skip ${TESTLISTS} ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
-
-    if os.environ.get('RUN_FROM_BUILD_FARM') is None and not Options.options.FILTERED_SUBUNIT:
-        cmd += ' | ${FORMAT_TEST_OUTPUT}'
+    env.CORE_COMMAND = '${PERL} ${srcdir}/selftest/selftest.pl --target=samba --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${srcdir}/selftest/skip ${TESTLISTS} ${OPTIONS} ${TESTS}'
+    if Options.options.LIST:
+        cmd = '${CORE_COMMAND} --list'
     else:
-        cmd += ' | ${PYTHON} -u ${srcdir}/selftest/filter-subunit'
+        env.OPTIONS += ' --socket-wrapper'
+        cmd = '(${CORE_COMMAND} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
+        if (os.environ.get('RUN_FROM_BUILD_FARM') is None and
+            not Options.options.FILTERED_SUBUNIT):
+            cmd += ' | ${FORMAT_TEST_OUTPUT}'
+        else:
+            cmd += ' | ${PYTHON} -u ${srcdir}/selftest/filter-subunit'
     runcmd = EXPAND_VARIABLES(opt, cmd)
 
     print("test: running %s" % runcmd)
     ret = RUN_COMMAND(cmd, env=env)
-    if os.path.exists(".testrepository"):
+    if os.path.exists(".testrepository") and not Options.options.LIST:
         # "testr load -q" isn't
         testrcmd = 'testr load -q < ${SELFTEST_PREFIX}/subunit > /dev/null'
         runcmd = EXPAND_VARIABLES(opt, testrcmd)