diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-03-12 17:56:44 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-03-14 12:21:05 +0000 |
commit | 07818dac6acc7a805548be4b605320dd27de126c (patch) | |
tree | 768d8eff8970d3c51312153ea0426660f11c9779 /run_unittests.py | |
parent | 5f00c3020073962edbeb2f3f709c27acdb09fd74 (diff) | |
download | meson-07818dac6acc7a805548be4b605320dd27de126c.zip meson-07818dac6acc7a805548be4b605320dd27de126c.tar.gz meson-07818dac6acc7a805548be4b605320dd27de126c.tar.bz2 |
compilers: Try harder to dedup builtin libs
Compiler internal libs should always be de-duplicated, no matter what.
Closes https://github.com/mesonbuild/meson/issues/2150
Test case is by Bruce Richardson in the issue.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py index 3f1a290..0b2164f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3893,7 +3893,7 @@ class WindowsTests(BasePlatformTests): if cc.get_argument_syntax() != 'msvc': raise unittest.SkipTest('Not using MSVC') # To force people to update this test, and also test - self.assertEqual(set(cc.ignore_libs), {'c', 'm', 'pthread', 'dl', 'rt'}) + self.assertEqual(set(cc.ignore_libs), {'c', 'm', 'pthread', 'dl', 'rt', 'execinfo'}) for l in cc.ignore_libs: self.assertEqual(cc.find_library(l, env, []), []) @@ -5043,6 +5043,19 @@ endian = 'little' max_count = max(max_count, line.count(search_term)) self.assertEqual(max_count, 1, 'Export dynamic incorrectly deduplicated.') + def test_compiler_libs_static_dedup(self): + testdir = os.path.join(self.unit_test_dir, '55 dedup compiler libs') + self.init(testdir) + build_ninja = os.path.join(self.builddir, 'build.ninja') + with open(build_ninja, 'r', encoding='utf-8') as f: + lines = f.readlines() + for lib in ('-ldl', '-lm', '-lc', '-lrt'): + for line in lines: + if lib not in line: + continue + # Assert that + self.assertEqual(len(line.split(lib)), 2, msg=(lib, line)) + def should_run_cross_arm_tests(): return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm') |