diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-22 00:47:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-22 00:47:20 +0200 |
commit | d882b6fbd466940d452cfaa890bd9270e10a93b4 (patch) | |
tree | d1ed9d893da50afb4ed3e6f031da91949f1d67ee /run_project_tests.py | |
parent | fdb48a3a0f0425a6bd4a71a2e004479080955df8 (diff) | |
parent | f9e88cd37e6babc1de476398f54a540f3eeca1c7 (diff) | |
download | meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.zip meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.tar.gz meson-d882b6fbd466940d452cfaa890bd9270e10a93b4.tar.bz2 |
Merge pull request #2498 from mesonbuild/runpython
Add possibility to run Python scripts with current interpreter
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 17e095b..b94a976 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -33,7 +33,7 @@ import time import multiprocessing import concurrent.futures as conc import re -from run_unittests import get_fake_options, run_configure_inprocess +from run_unittests import get_fake_options, run_configure from run_tests import get_backend_commands, get_backend_args_for_dir, Backend from run_tests import ensure_backend_detects_changes @@ -322,14 +322,31 @@ def run_test(skipped, testdir, extra_args, compiler, backend, flags, commands, s finally: mlog.shutdown() # Close the log file because otherwise Windows wets itself. +def pass_prefix_to_test(dirname): + if '40 prefix' in dirname: + return False + return True + +def pass_libdir_to_test(dirname): + if '8 install' in dirname: + return False + if '39 libdir' in dirname: + return False + return True + def _run_test(testdir, test_build_dir, install_dir, extra_args, compiler, backend, flags, commands, should_fail): compile_commands, clean_commands, install_commands, uninstall_commands = commands test_args = parse_test_args(testdir) gen_start = time.time() # Configure in-process - gen_command = [meson_command, '--prefix', '/usr', '--libdir', 'lib', testdir, test_build_dir]\ - + flags + test_args + extra_args - (returncode, stdo, stde) = run_configure_inprocess(gen_command) + if pass_prefix_to_test(testdir): + gen_args = ['--prefix', '/usr'] + else: + gen_args = [] + if pass_libdir_to_test(testdir): + gen_args += ['--libdir', 'lib'] + gen_args += [testdir, test_build_dir] + flags + test_args + extra_args + (returncode, stdo, stde) = run_configure(meson_command, gen_args) try: logfile = os.path.join(test_build_dir, 'meson-logs/meson-log.txt') with open(logfile, errors='ignore') as f: @@ -603,7 +620,7 @@ def check_meson_commands_work(): testdir = 'test cases/common/1 trivial' with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: print('Checking that configuring works...') - gen_cmd = [sys.executable, meson_command, testdir, build_dir] + backend_flags + gen_cmd = mesonlib.meson_command + [testdir, build_dir] + backend_flags pc, o, e = Popen_safe(gen_cmd) if pc.returncode != 0: raise RuntimeError('Failed to configure {!r}:\n{}\n{}'.format(testdir, e, o)) |