aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-04-06 08:16:08 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-04-09 23:11:05 +0530
commita331bf1162030c9aedc3b9ad33350fe28b7c35db (patch)
tree23ec062a0601a8d7e8161e5e2b5fa625bbab7cd7 /run_tests.py
parent7e4a67c7906ef736870650031f332a17be6673e6 (diff)
downloadmeson-a331bf1162030c9aedc3b9ad33350fe28b7c35db.zip
meson-a331bf1162030c9aedc3b9ad33350fe28b7c35db.tar.gz
meson-a331bf1162030c9aedc3b9ad33350fe28b7c35db.tar.bz2
unit tests: Run on all backends, not just Ninja
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/run_tests.py b/run_tests.py
index ebccaa6..7ea633e 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -40,14 +40,17 @@ def get_backend_args_for_dir(backend, builddir):
return [os.path.split(sln_name)[-1]]
return []
-def get_build_target_args(backend, target):
+def get_builddir_target_args(backend, builddir, target):
+ dir_args = get_backend_args_for_dir(backend, builddir)
if target is None:
- return []
+ return dir_args
if backend.startswith('vs'):
- return ['/target:' + target]
- if backend == 'xcode':
- return ['-target', target]
- return [target]
+ target_args = ['/target:' + target]
+ elif backend == 'xcode':
+ target_args = ['-target', target]
+ else:
+ target_args = [target]
+ return target_args + dir_args
def get_backend_commands(backend, debug=False):
install_cmd = []
@@ -108,10 +111,10 @@ if __name__ == '__main__':
units += ['LinuxlikeTests']
elif mesonlib.is_windows():
units += ['WindowsTests']
- # Unit tests always use the Ninja backend, so just skip them if we're
- # testing the VS backend
- if backend is Backend.ninja:
- returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v'] + units)
+ # Can't pass arguments to unit tests, so set the backend to use in the environment
+ env = os.environ.copy()
+ env['MESON_UNIT_TEST_BACKEND'] = backend.name
+ returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v'] + units, env=env)
# Ubuntu packages do not have a binary without -6 suffix.
if shutil.which('arm-linux-gnueabihf-gcc-6') and not platform.machine().startswith('arm'):
print('Running cross compilation tests.\n')