diff options
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 28 |
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()) |