aboutsummaryrefslogtreecommitdiff
path: root/unittests/platformagnostictests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2022-10-10 22:17:00 +0300
committerGitHub <noreply@github.com>2022-10-10 22:17:00 +0300
commit46acd6cd4ac33973daee5436dca8c3035c8f464c (patch)
treec39388c6957f08aca7db20484f905cdf66b35301 /unittests/platformagnostictests.py
parent58581ae3debcb0d043093cc787b560cfd2a22c75 (diff)
parent8c3a87847e8469c4b49a1ed130247e4ff023072a (diff)
downloadmeson-46acd6cd4ac33973daee5436dca8c3035c8f464c.zip
meson-46acd6cd4ac33973daee5436dca8c3035c8f464c.tar.gz
meson-46acd6cd4ac33973daee5436dca8c3035c8f464c.tar.bz2
Merge pull request #8941 from xclaesse/wrapdb
Automatically use WrapDB 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)