aboutsummaryrefslogtreecommitdiff
path: root/unittests/platformagnostictests.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-06-28 12:20:32 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2022-10-10 12:47:32 -0400
commit8c3a87847e8469c4b49a1ed130247e4ff023072a (patch)
treea817fc4ba899ad441912ac91038e31b5e06acf57 /unittests/platformagnostictests.py
parent39d825fabfde54268b990aaec23539800c95ca89 (diff)
downloadmeson-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.py19
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)