aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2014-03-26 15:53:46 +0100
committerJeremy Lainé <jeremy.laine@m4x.org>2014-03-26 15:53:46 +0100
commit1e3d53227feb5e21706494f960a69b87eed3df1b (patch)
treed7efc86b6f24915fda0666ac62bdbb9b5047e1f4
parent742f672a580461271cbe25c5e87f42e9dc4c3ede (diff)
downloadqxmpp-1e3d53227feb5e21706494f960a69b87eed3df1b.tar.gz
fail tests/run.py if any tests fail
-rwxr-xr-xtests/run.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/run.py b/tests/run.py
index 6acbd288..b816d7b3 100755
--- a/tests/run.py
+++ b/tests/run.py
@@ -3,6 +3,7 @@
import getopt
import os
import platform
+import subprocess
import sys
root = os.path.dirname(__file__)
@@ -36,6 +37,7 @@ else:
os.environ['LD_LIBRARY_PATH'] = path
# run tests
+failed = False
for test in os.listdir(root):
test_path = os.path.join(root, test)
if os.path.isdir(test_path):
@@ -47,7 +49,15 @@ for test in os.listdir(root):
prog = os.path.join(test_path, 'tst_' + test)
if not os.path.exists(prog):
continue
+
+ cmd = [ prog ]
if report_path:
- os.system('%s -xunitxml -o %s/%s.xml' % (prog, report_path, test))
- else:
- os.system(prog)
+ cmd += ['-xunitxml', '-o', os.path.join(report_path, test + '.xml') ]
+ try:
+ subprocess.check_call(cmd)
+ except subprocess.CalledProcessError:
+ failed = True
+
+# check for failure
+if failed:
+ sys.exit(1)