aboutsummaryrefslogtreecommitdiff
path: root/run_cross_test.py
diff options
context:
space:
mode:
authorNiklas Claesson <nicke.claesson@gmail.com>2018-10-10 21:17:24 +0200
committerNiklas Claesson <nicke.claesson@gmail.com>2018-10-10 21:19:06 +0200
commit4ef4edee2f460a354cca0c381d08604f6837c496 (patch)
tree1eb5308b3beb94e1e2d4e7416fe9ce9a6f1acc8d /run_cross_test.py
parenta0a0c244e2a062ceba357f05d4852cd063f0b0cd (diff)
downloadmeson-4ef4edee2f460a354cca0c381d08604f6837c496.zip
meson-4ef4edee2f460a354cca0c381d08604f6837c496.tar.gz
meson-4ef4edee2f460a354cca0c381d08604f6837c496.tar.bz2
tests runners: Refactor out global variables and add argparse
Diffstat (limited to 'run_cross_test.py')
-rwxr-xr-xrun_cross_test.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/run_cross_test.py b/run_cross_test.py
index 7191402..60be8a2 100755
--- a/run_cross_test.py
+++ b/run_cross_test.py
@@ -25,6 +25,7 @@ Eventually migrate to something fancier.'''
import sys
import os
from pathlib import Path
+import argparse
from run_project_tests import gather_tests, run_tests, StopException, setup_commands
from run_project_tests import failing_logs
@@ -40,11 +41,16 @@ def runtests(cross_file):
print('Total skipped cross tests:', skipped_tests)
if failing_tests > 0 and ('TRAVIS' in os.environ or 'APPVEYOR' in os.environ):
print('\nMesonlogs of failing tests\n')
- for l in failing_logs:
- print(l, '\n')
- sys.exit(failing_tests)
+ for log in failing_logs:
+ print(log, '\n')
+ return failing_tests
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('cross_file')
+ options = parser.parse_args()
+ setup_commands('ninja')
+ return runtests(options.cross_file)
if __name__ == '__main__':
- setup_commands('ninja')
- cross_file = sys.argv[1]
- runtests(cross_file)
+ sys.exit(main())