diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-08-24 23:23:42 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-08-24 23:23:42 +0300 |
commit | 7df6f7b7ebbb423210fddda65f9e37e6b4751f78 (patch) | |
tree | d30d14476f12fe72afa3cb5ba416e036ed15687f /run_unittests.py | |
parent | 550a03ee240d75d27cc5fc01cde59a048f3b08bd (diff) | |
download | meson-fix0512tests.tar.gz |
Fix tests for 0.51.2.fix0512tests
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/run_unittests.py b/run_unittests.py index d28f903ae..2b2da7c1a 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3604,20 +3604,19 @@ recommended as it is not supported on some platforms''') self.setconf('-Dcpp_std=c++14') self.setconf('-Dbuildtype=release') - for idx, i in enumerate(res1): + with open(introfile, 'r') as fp: + res2 = json.load(fp) + + for idx, i in enumerate(res2): if i['name'] == 'cpp_std': - res1[idx]['value'] = 'c++14' + self.assertEqual(res2[idx]['value'], 'c++14') if i['name'] == 'buildtype': - res1[idx]['value'] = 'release' + self.assertEqual(res2[idx]['value'], 'release') if i['name'] == 'optimization': - res1[idx]['value'] = '3' + self.assertEqual(res2[idx]['value'], '3') if i['name'] == 'debug': - res1[idx]['value'] = False - - with open(introfile, 'r') as fp: - res2 = json.load(fp) + self.assertEqual(res2[idx]['value'], False) - self.assertListEqual(res1, res2) def test_introspect_targets_from_source(self): testdir = os.path.join(self.unit_test_dir, '55 introspection') @@ -5215,20 +5214,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, '55 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_std_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, '50 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): @@ -5296,12 +5289,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, '50 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, '55 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()) |