diff options
author | Ole André Vadla RavnÄs <oleavr@gmail.com> | 2017-05-21 20:35:44 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-21 23:04:19 +0300 |
commit | b595cda4ed0ca699da3052a6bd30ba7d1dae1124 (patch) | |
tree | 587c4654ebe3d2956fdca855c23f62f32e5fa346 /run_unittests.py | |
parent | 5794f37af5c5ce0010168d163f2568d7581b5a13 (diff) | |
download | meson-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_unittests.py')
-rwxr-xr-x | run_unittests.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 85474e8..e3b7c5c 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1540,6 +1540,27 @@ class LinuxlikeTests(BasePlatformTests): env['LD_LIBRARY_PATH'] = installed_libdir self.assertEqual(subprocess.call(installed_exe, env=env), 0) +class LinuxArmCrossCompileTests(BasePlatformTests): + ''' + Tests that verify cross-compilation to Linux/ARM + ''' + def setUp(self): + super().setUp() + src_root = os.path.dirname(__file__) + self.meson_command += ['--cross=' + os.path.join(src_root, 'cross', 'ubuntu-armhf.txt')] + + def test_cflags_cross_environment_pollution(self): + ''' + Test that the CFLAGS environment variable does not pollute the cross + environment. This can't be an ordinary test case because we need to + inspect the compiler database. + ''' + testdir = os.path.join(self.common_test_dir, '3 static') + os.environ['CFLAGS'] = '-DBUILD_ENVIRONMENT_ONLY' + self.init(testdir) + compdb = self.get_compdb() + self.assertNotIn('-DBUILD_ENVIRONMENT_ONLY', compdb[0]['command']) + class RewriterTests(unittest.TestCase): def setUp(self): |