aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-01-30 23:13:24 +0200
committerGitHub <noreply@github.com>2020-01-30 23:13:24 +0200
commitd8faf9b7062e2278adddb3b107ea58784fe544d4 (patch)
tree921000d644959ca875fb8275995a5c8b7263b5a1 /run_project_tests.py
parent00f5dadd5b7d71c30bd7393d165a87f554eb92e5 (diff)
parentd4c7ff173a19d2180c539e27f1b49a53668e5ad7 (diff)
downloadmeson-d8faf9b7062e2278adddb3b107ea58784fe544d4.zip
meson-d8faf9b7062e2278adddb3b107ea58784fe544d4.tar.gz
meson-d8faf9b7062e2278adddb3b107ea58784fe544d4.tar.bz2
Merge pull request #6536 from jon-turney/cross-testing-refactor
Refactor CI cross-testing
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index e4dd8f7..2288abf 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -871,13 +871,13 @@ def check_format():
continue
check_file(root / file)
-def check_meson_commands_work():
+def check_meson_commands_work(options):
global backend, compile_commands, test_commands, install_commands
testdir = PurePath('test cases', 'common', '1 trivial').as_posix()
meson_commands = mesonlib.python_command + [get_meson_script()]
with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir:
print('Checking that configuring works...')
- gen_cmd = meson_commands + [testdir, build_dir] + backend_flags
+ gen_cmd = meson_commands + [testdir, build_dir] + backend_flags + options.extra_args
pc, o, e = Popen_safe(gen_cmd)
if pc.returncode != 0:
raise RuntimeError('Failed to configure {!r}:\n{}\n{}'.format(testdir, e, o))
@@ -897,11 +897,14 @@ def check_meson_commands_work():
raise RuntimeError('Failed to install {!r}:\n{}\n{}'.format(testdir, e, o))
-def detect_system_compiler():
+def detect_system_compiler(options):
global system_compiler
with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir:
- env = environment.Environment(None, build_dir, get_fake_options('/'))
+ fake_opts = get_fake_options('/')
+ if options.cross_file:
+ fake_opts.cross_file = [options.cross_file]
+ env = environment.Environment(None, build_dir, fake_opts)
print()
for lang in sorted(compilers.all_languages):
try:
@@ -962,16 +965,19 @@ if __name__ == '__main__':
parser.add_argument('--no-unittests', action='store_true',
help='Not used, only here to simplify run_tests.py')
parser.add_argument('--only', help='name of test(s) to run', nargs='+', choices=ALL_TESTS)
+ parser.add_argument('--cross-file', action='store', help='File describing cross compilation environment.')
options = parser.parse_args()
- setup_commands(options.backend)
+ if options.cross_file:
+ options.extra_args += ['--cross-file', options.cross_file]
- detect_system_compiler()
+ setup_commands(options.backend)
+ detect_system_compiler(options)
print_tool_versions()
script_dir = os.path.split(__file__)[0]
if script_dir != '':
os.chdir(script_dir)
check_format()
- check_meson_commands_work()
+ check_meson_commands_work(options)
try:
all_tests = detect_tests_to_run(options.only)
(passing_tests, failing_tests, skipped_tests) = run_tests(all_tests, 'meson-test-run', options.failfast, options.extra_args)