aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorYang Bo <yb@rslinux.fun>2022-09-08 11:29:30 +0000
committerEli Schwartz <eschwartz93@gmail.com>2022-09-13 02:24:38 -0400
commit83d18d137dc50437a8263983e8883198c7bc41ed (patch)
tree0ba5ba3e09dd005fbe516342bb66f679b050099a /unittests
parent719dd0d2a04592812194e8588279827ec52fc92e (diff)
downloadmeson-83d18d137dc50437a8263983e8883198c7bc41ed.zip
meson-83d18d137dc50437a8263983e8883198c7bc41ed.tar.gz
meson-83d18d137dc50437a8263983e8883198c7bc41ed.tar.bz2
Use os.path.realpath for default include paths testing in -isystem.
This ensures correct removal of default include paths in -isystem options when symbolic links are involved. A test for this is also added.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/linuxliketests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
index 99adeac..d7d657d 100644
--- a/unittests/linuxliketests.py
+++ b/unittests/linuxliketests.py
@@ -1793,3 +1793,15 @@ class LinuxlikeTests(BasePlatformTests):
self._run(install_cmd + ['--strip'], workdir=self.builddir)
stdout = self._run(['file', '-b', lib])
self.assertNotIn('not stripped', stdout)
+
+ def test_isystem_default_removal_with_symlink(self):
+ env = get_fake_env()
+ cpp = detect_cpp_compiler(env, MachineChoice.HOST)
+ default_dirs = cpp.get_default_include_dirs()
+ default_symlinks = []
+ with tempfile.TemporaryDirectory() as tmpdir:
+ for i in range(len(default_dirs)):
+ symlink = f'{tmpdir}/default_dir{i}'
+ default_symlinks.append(symlink)
+ os.symlink(default_dirs[i], symlink)
+ self.assertFalse(cpp.compiler_args([f'-isystem{symlink}' for symlink in default_symlinks]).to_native())