summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml6
-rwxr-xr-xruntest.py26
2 files changed, 25 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index 9a23b1b..1192edd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,7 +21,11 @@ script:
- echo "[run]" >> .coveragerc
- echo "source = $PWD/src" >> .coveragerc
- echo "parallel = True" >> .coveragerc
- - coverage run --rcfile=$PWD/.coveragerc runtest.py -a || if [[ $? == 2 ]]; then true; else false; fi
+# WORKAROUND: attempt to retry JobTests.py if it fails and then continue if it passes, if it fails ten times
+# then it is a real failure not related to intermittent travis failures
+ - n=0; while [[ $n -lt 10 ]]; do coverage run --rcfile=$PWD/.coveragerc runtest.py src/engine/SCons/JobTests.py && break; n=$((n+1)); done; if [ "$n" -gt "9" ]; then false; fi
+# exclude JobTest.py becuase we already ran that
+ - coverage run --rcfile=$PWD/.coveragerc runtest.py -a --exclude-list exclude.test || if [[ $? == 2 ]]; then true; else false; fi
after_success:
- coverage combine
diff --git a/runtest.py b/runtest.py
index 487100b..88ea45c 100755
--- a/runtest.py
+++ b/runtest.py
@@ -72,6 +72,10 @@
# This is (will be) used for reporting results back
# to a central SCons test monitoring infrastructure.
#
+# --exclude-list file
+# list of tests to exclude in the current selection of test
+# mostly meant to easily exclude tests from -a option
+#
# (Note: There used to be a -v option that specified the SCons
# version to be tested, when we were installing in a version-specific
# library directory. If we ever resurrect that as the default, then
@@ -126,6 +130,7 @@ suppress_stdout = False
suppress_stderr = False
allow_pipe_files = True
quit_on_failure = False
+excludelistfile = None
usagestr = """\
Usage: runtest.py [OPTIONS] [TEST ...]
@@ -173,6 +178,8 @@ Options:
-X Test script is executable, don't feed to Python.
-x --exec SCRIPT Test SCRIPT.
--xml file Save results to file in SCons XML format.
+ --exclude-list FILE List of tests to exclude in the current selection of test,
+ mostly meant to easily exclude tests from the -a option
Environment Variables:
@@ -224,7 +231,7 @@ opts, args = getopt.getopt(args, "b:def:hj:klnP:p:qsv:Xx:t",
'quit-on-failure',
'short-progress', 'time',
'version=', 'exec=',
- 'verbose='])
+ 'verbose=', 'exclude-list='])
for o, a in opts:
if o in ['-b', '--baseline']:
@@ -284,7 +291,8 @@ for o, a in opts:
scons_exec = 1
elif o in ['-x', '--exec']:
scons = a
-
+ elif o in ['--exclude-list']:
+ excludelistfile = a
# --- setup stdout/stderr ---
@@ -642,7 +650,7 @@ if old_pythonpath:
# ---[ test discovery ]------------------------------------
tests = []
-
+excludetests = []
unittests = []
endtests = []
@@ -734,7 +742,7 @@ else:
tests.extend(unittests)
tests.extend(endtests)
tests.sort()
-
+
if not tests:
sys.stderr.write(usagestr + """
runtest.py: No tests were found.
@@ -743,9 +751,15 @@ runtest.py: No tests were found.
""")
sys.exit(1)
+if excludelistfile:
+ excludetests = open(excludelistfile, 'r').readlines()
+ excludetests = [x for x in excludetests if x[0] != '#']
+ excludetests = [x[:-1] for x in excludetests]
+ excludetests = [x.strip() for x in excludetests]
+ excludetests = [x for x in excludetests if len(x) > 0]
# ---[ test processing ]-----------------------------------
-
+tests = [t for t in tests if t not in excludetests]
tests = [Test(t) for t in tests]
if list_only:
@@ -927,4 +941,4 @@ else:
# tab-width:4
# indent-tabs-mode:nil
# End:
-# vim: set expandtab tabstop=4 shiftwidth=4:
+# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file