diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-06-28 12:20:32 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2022-10-10 12:47:32 -0400 |
commit | 8c3a87847e8469c4b49a1ed130247e4ff023072a (patch) | |
tree | a817fc4ba899ad441912ac91038e31b5e06acf57 /unittests/platformagnostictests.py | |
parent | 39d825fabfde54268b990aaec23539800c95ca89 (diff) | |
download | meson-8c3a87847e8469c4b49a1ed130247e4ff023072a.zip meson-8c3a87847e8469c4b49a1ed130247e4ff023072a.tar.gz meson-8c3a87847e8469c4b49a1ed130247e4ff023072a.tar.bz2 |
Document and test new WrapDB auto fallback
Diffstat (limited to 'unittests/platformagnostictests.py')
-rw-r--r-- | unittests/platformagnostictests.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py index a2d6640..ed5d96b 100644 --- a/unittests/platformagnostictests.py +++ b/unittests/platformagnostictests.py @@ -14,7 +14,10 @@ import os import tempfile +import subprocess +import textwrap from unittest import skipIf +from pathlib import Path from .baseplatformtests import BasePlatformTests from .helpers import is_ci @@ -94,3 +97,19 @@ class PlatformAgnosticTests(BasePlatformTests): # https://github.com/mesonbuild/meson/issues/10225. self.setconf('-Dfoo=enabled') self.build('reconfigure') + + def test_update_wrapdb(self): + # Write the project into a temporary directory because it will add files + # into subprojects/ and we don't want to pollute meson source tree. + with tempfile.TemporaryDirectory() as testdir: + with Path(testdir, 'meson.build').open('w', encoding='utf-8') as f: + f.write(textwrap.dedent( + ''' + project('wrap update-db', + default_options: ['wrap_mode=forcefallback']) + + zlib_dep = dependency('zlib') + assert(zlib_dep.type_name() == 'internal') + ''')) + subprocess.check_call(self.wrap_command + ['update-db'], cwd=testdir) + self.init(testdir, workdir=testdir) |