diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-11-08 13:43:58 -0800 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2021-11-24 02:23:57 +0530 |
commit | bd9d9818711eaba18b774e17c9ce405c5020c6f9 (patch) | |
tree | 47cc4426a2889fa8f97a193591c99611b9ab1b3c /unittests/allplatformstests.py | |
parent | 73bac14c8fe7279037433b15b6c15bc93e9156a1 (diff) | |
download | meson-bd9d9818711eaba18b774e17c9ce405c5020c6f9.zip meson-bd9d9818711eaba18b774e17c9ce405c5020c6f9.tar.gz meson-bd9d9818711eaba18b774e17c9ce405c5020c6f9.tar.bz2 |
unit tests: Extend prebuilt test to test intermediate
This provides coverage for the bug:
https://github.com/mesonbuild/meson/issues/9542
Diffstat (limited to 'unittests/allplatformstests.py')
-rw-r--r-- | unittests/allplatformstests.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index d0a1632..03992bd 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -1516,6 +1516,29 @@ class AllPlatformTests(BasePlatformTests): self.build() self.run_tests() + def test_prebuilt_shared_lib_rpath(self) -> None: + (cc, _, object_suffix, shared_suffix) = self.detect_prebuild_env() + tdir = os.path.join(self.unit_test_dir, '17 prebuilt shared') + with tempfile.TemporaryDirectory() as d: + source = os.path.join(tdir, 'alexandria.c') + objectfile = os.path.join(d, 'alexandria.' + object_suffix) + impfile = os.path.join(d, 'alexandria.lib') + if cc.get_argument_syntax() == 'msvc': + shlibfile = os.path.join(d, 'alexandria.' + shared_suffix) + elif is_cygwin(): + shlibfile = os.path.join(d, 'cygalexandria.' + shared_suffix) + else: + shlibfile = os.path.join(d, 'libalexandria.' + shared_suffix) + # Ensure MSVC extra files end up in the directory that gets deleted + # at the end + with chdir(d): + self.build_shared_lib(cc, source, objectfile, shlibfile, impfile) + + # Run the test + self.init(tdir, extra_args=[f'-Dsearch_dir={d}']) + self.build() + self.run_tests() + @skipIfNoPkgconfig def test_pkgconfig_static(self): ''' |