aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-10-11 23:27:44 +0300
committerGitHub <noreply@github.com>2018-10-11 23:27:44 +0300
commit253fcb37af3f6d853d431d06aaf75c09292342b6 (patch)
tree8336395507fdc9302b22519bb0170174dcbd4b2f /run_unittests.py
parentbe07a710ee45232a60b6add2da7b9e33f90a1d2f (diff)
parentd964da79e76b2e75d6fdaa06f48098e54cba8024 (diff)
downloadmeson-253fcb37af3f6d853d431d06aaf75c09292342b6.zip
meson-253fcb37af3f6d853d431d06aaf75c09292342b6.tar.gz
meson-253fcb37af3f6d853d431d06aaf75c09292342b6.tar.bz2
Merge pull request #3424 from NickeZ/nickez/fail-fast
Add option to fail fast in tests
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 9ffce52..9b7e45a 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -16,11 +16,13 @@
import stat
import shlex
import subprocess
-import re, json
+import re
+import json
import tempfile
import textwrap
import os
import shutil
+import sys
import unittest
import platform
from itertools import chain
@@ -4329,7 +4331,7 @@ def should_run_cross_arm_tests():
def should_run_cross_mingw_tests():
return shutil.which('x86_64-w64-mingw32-gcc') and not (is_windows() or is_cygwin())
-if __name__ == '__main__':
+def main():
unset_envs()
cases = ['InternalTests', 'DataTests', 'AllPlatformTests', 'FailureTests', 'PythonTests']
if not is_windows():
@@ -4343,4 +4345,7 @@ if __name__ == '__main__':
if is_osx():
cases += ['DarwinTests']
- unittest.main(defaultTest=cases, buffer=True)
+ return unittest.main(defaultTest=cases, buffer=True)
+
+if __name__ == '__main__':
+ sys.exit(main())