selftest: Fix combination of Samba3 and Samba4 test lists
authorAndrew Bartlett <abartlet@samba.org>
Thu, 28 Apr 2011 03:58:07 +0000 (13:58 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 28 Apr 2011 04:31:25 +0000 (14:31 +1000)
The previous code was too subtle, and tried to filter via two xfail
scripts.  The --fail-immediately for the source3 knownfail would then
fail samba4 know failures.

Andrew Bartlett

Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

selftest/wscript
source3/selftest/quick [new file with mode: 0644]

index 25ea823ff7d0452ace7a3a31a8f6c5e34b4ed23a..b3e683f0381bf98ea975b3716612a2d7aaa52d37 100644 (file)
@@ -73,6 +73,19 @@ def set_options(opt):
 def configure(conf):
     conf.env.SELFTEST_PREFIX = Options.options.SELFTEST_PREFIX
 
+def combine_files(file1, file2, outfile):
+
+    f1 = open(file1)
+    f2 = open(file2)
+    of = open(outfile, mode='w')
+    for line in f1:
+        of.write(line)
+    for line in f2:
+        of.write(line)
+    f1.close()
+    f2.close()
+    of.close()
+
 def cmd_testonly(opt):
     '''run tests without doing a build first'''
     env = LOAD_ENVIRONMENT()
@@ -183,17 +196,19 @@ def cmd_testonly(opt):
         env.SELFTEST_DIR = "${srcdir}/source3/selftest"
 
     if env.SELFTEST_TARGET == "samba":
-        env.SELFTEST_DIR = "${srcdir}/source3/selftest"
-        xfail = ""
-        xfail += EXPAND_VARIABLES(opt, env.FILTER_XFAIL)
-        xfail += " | "
-        env.SELFTEST_DIR = "${srcdir}/source4/selftest"
-        xfail += EXPAND_VARIABLES(opt, env.FILTER_XFAIL)
-        env.FILTER_XFAIL = xfail;
-        cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude="${srcdir}/source4/selftest/skip" --exclude="${srcdir}/source3/selftest/skip" --testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" --testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
+        for f in ["knownfail", "slow", "quick", "skip" ]:
+            combine_files(env.srcdir + "/source4/selftest/" + f,
+                          env.srcdir + "/source3/selftest/" + f,
+                          env.SELFTEST_PREFIX + "/" + f)
+
+        env.SELFTEST_DIR = "${srcdir}/st"
+        env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" ' +
+                         '--testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|"')
     else:
-        # 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=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${SELFTEST_DIR}/skip --testlist="${PYTHON} ${SELFTEST_DIR}/tests.py|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
+        env.TESTLISTS = '--testlist="${SELFTEST_DIR}/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=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${SELFTEST_DIR}/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}'
diff --git a/source3/selftest/quick b/source3/selftest/quick
new file mode 100644 (file)
index 0000000..bb3b066
--- /dev/null
@@ -0,0 +1 @@
+#none