summaryrefslogtreecommitdiff
path: root/source4/selftest/wscript
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-06-25 01:21:14 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-25 01:21:14 +0200
commite0aa54d0ed25a55fd6b4f5d08644d37981572fdd (patch)
tree5f87c295b8d0c27b41e116c7e99140bc38ad68d6 /source4/selftest/wscript
parent700fcfbc63c4b20fcb35dc3c7ef50ed20117cf74 (diff)
downloadsamba-e0aa54d0ed25a55fd6b4f5d08644d37981572fdd.tar.gz
samba-e0aa54d0ed25a55fd6b4f5d08644d37981572fdd.tar.bz2
samba-e0aa54d0ed25a55fd6b4f5d08644d37981572fdd.zip
selftest: Store the output of the last test run in st/subunit.
If a testrepository repository is present, add the test output when it has completed.
Diffstat (limited to 'source4/selftest/wscript')
-rw-r--r--source4/selftest/wscript13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/selftest/wscript b/source4/selftest/wscript
index 5e42e6fb67..8244e6e17a 100644
--- a/source4/selftest/wscript
+++ b/source4/selftest/wscript
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# vim: expandtab ft=python
# selftest main code.
@@ -95,8 +96,6 @@ def cmd_testonly(opt):
env.FILTER_OPTIONS = '${FILTER_XFAIL} --strip-passed-output'
else:
env.FILTER_OPTIONS = '${FILTER_XFAIL}'
- if not Options.options.FILTERED_SUBUNIT:
- env.FILTER_OPTIONS += ' | ${FORMAT_TEST_OUTPUT}'
if Options.options.VALGRIND:
os.environ['VALGRIND'] = 'valgrind -q --num-callers=30'
@@ -119,11 +118,19 @@ def cmd_testonly(opt):
if os.path.exists(st_done):
os.unlink(st_done)
- cmd = '(${PERL} ../selftest/selftest.pl --prefix=${SELFTEST_PREFIX} --builddir=. --srcdir=. --exclude=./selftest/skip --testlist="./selftest/tests.sh|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS}'
+ cmd = '(${PERL} ../selftest/selftest.pl --prefix=${SELFTEST_PREFIX} --builddir=. --srcdir=. --exclude=./selftest/skip --testlist="./selftest/tests.sh|" ${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}'
cmd = EXPAND_VARIABLES(opt, cmd)
print("test: running %s" % cmd)
ret = RUN_COMMAND(cmd, env=env)
+ if os.path.exists(".testrepository"):
+ # "testr load -q" isn't
+ cmd = 'testr load -q < ${SELFTEST_PREFIX}/subunit > /dev/null'
+ cmd = EXPAND_VARIABLES(opt, cmd)
+ RUN_COMMAND(cmd, env=env)
+
if ret != 0:
print("ERROR: test failed with exit code %d" % ret)
sys.exit(ret)