aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorOle André Vadla RavnÄs <oleavr@gmail.com>2017-05-21 20:35:44 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-05-21 23:04:19 +0300
commitb595cda4ed0ca699da3052a6bd30ba7d1dae1124 (patch)
tree587c4654ebe3d2956fdca855c23f62f32e5fa346 /run_tests.py
parent5794f37af5c5ce0010168d163f2568d7581b5a13 (diff)
downloadmeson-b595cda4ed0ca699da3052a6bd30ba7d1dae1124.zip
meson-b595cda4ed0ca699da3052a6bd30ba7d1dae1124.tar.gz
meson-b595cda4ed0ca699da3052a6bd30ba7d1dae1124.tar.bz2
Fix cross environment pollution.
Environment variables like CFLAGS and LDFLAGS should not affect the cross environment. Fixes #1772
Diffstat (limited to 'run_tests.py')
-rwxr-xr-xrun_tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/run_tests.py b/run_tests.py
index a374839..7ef9cf4 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -114,6 +114,9 @@ def get_fake_options(prefix):
opts.prefix = prefix
return opts
+def should_run_linux_cross_tests():
+ return shutil.which('arm-linux-gnueabihf-gcc-6') and not platform.machine().startswith('arm')
+
class FakeEnvironment(object):
def __init__(self):
self.cross_info = None
@@ -154,6 +157,8 @@ if __name__ == '__main__':
units = ['InternalTests', 'AllPlatformTests']
if mesonlib.is_linux():
units += ['LinuxlikeTests']
+ if should_run_linux_cross_tests():
+ units += ['LinuxArmCrossCompileTests']
elif mesonlib.is_windows():
units += ['WindowsTests']
# Can't pass arguments to unit tests, so set the backend to use in the environment
@@ -161,7 +166,7 @@ if __name__ == '__main__':
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'):
+ if should_run_linux_cross_tests():
print('Running cross compilation tests.\n')
returncode += subprocess.call([sys.executable, 'run_cross_test.py', 'cross/ubuntu-armhf.txt'])
returncode += subprocess.call([sys.executable, 'run_project_tests.py'] + sys.argv[1:])