aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-07-17 22:54:58 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-08-06 21:34:15 +0300
commit5fd4963766fe53d4a6db24a2cb7cb54e21600fe9 (patch)
tree08c48cdf5927bfdf12d3a00a07135a2a9ad44b07 /run_unittests.py
parent534c95cc3eae86bb8e08bee5f5162ca65bc53461 (diff)
downloadmeson-5fd4963766fe53d4a6db24a2cb7cb54e21600fe9.zip
meson-5fd4963766fe53d4a6db24a2cb7cb54e21600fe9.tar.gz
meson-5fd4963766fe53d4a6db24a2cb7cb54e21600fe9.tar.bz2
Made build. options alias basic ones when native building.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 8212c46..735f3e2 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3717,6 +3717,8 @@ recommended as it is not supported on some platforms''')
for idx, i in enumerate(res1):
if i['name'] == 'cpp_std':
res1[idx]['value'] = 'c++14'
+ if i['name'] == 'build.cpp_std':
+ res1[idx]['value'] = 'c++14'
if i['name'] == 'buildtype':
res1[idx]['value'] = 'release'
if i['name'] == 'optimization':
@@ -5380,20 +5382,14 @@ endian = 'little'
# Assert that
self.assertEqual(len(line.split(lib)), 2, msg=(lib, line))
- @skipIfNoPkgconfig
- def test_pkg_config_option(self):
- testdir = os.path.join(self.unit_test_dir, '58 pkg_config_path option')
- self.init(testdir, extra_args=[
- '-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'),
- '-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'),
- ])
-
- def test_std_remains(self):
+ def test_noncross_options(self):
# C_std defined in project options must be in effect also when native compiling.
- testdir = os.path.join(self.unit_test_dir, '51 std remains')
- self.init(testdir)
+ testdir = os.path.join(self.unit_test_dir, '51 noncross options')
+ self.init(testdir, extra_args=['-Dpkg_config_path=' + testdir])
compdb = self.get_compdb()
+ self.assertEqual(len(compdb), 2)
self.assertRegex(compdb[0]['command'], '-std=c99')
+ self.assertRegex(compdb[1]['command'], '-std=c99')
self.build()
def test_identity_cross(self):
@@ -5461,12 +5457,20 @@ class LinuxCrossArmTests(BasePlatformTests):
def test_std_remains(self):
# C_std defined in project options must be in effect also when cross compiling.
- testdir = os.path.join(self.unit_test_dir, '51 std remains')
+ testdir = os.path.join(self.unit_test_dir, '51 noncross options')
self.init(testdir)
compdb = self.get_compdb()
self.assertRegex(compdb[0]['command'], '-std=c99')
self.build()
+ @skipIfNoPkgconfig
+ def test_pkg_config_option(self):
+ testdir = os.path.join(self.unit_test_dir, '58 pkg_config_path option')
+ self.init(testdir, extra_args=[
+ '-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'),
+ '-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'),
+ ])
+
def should_run_cross_mingw_tests():
return shutil.which('x86_64-w64-mingw32-gcc') and not (is_windows() or is_cygwin())