aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/240 dependency native host == build
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/common/240 dependency native host == build')
-rw-r--r--meson/test cases/common/240 dependency native host == build/meson.build18
-rw-r--r--meson/test cases/common/240 dependency native host == build/test.json14
2 files changed, 32 insertions, 0 deletions
diff --git a/meson/test cases/common/240 dependency native host == build/meson.build b/meson/test cases/common/240 dependency native host == build/meson.build
new file mode 100644
index 000000000..bdcd93cef
--- /dev/null
+++ b/meson/test cases/common/240 dependency native host == build/meson.build
@@ -0,0 +1,18 @@
+project('foo', 'c')
+
+if meson.is_cross_build()
+ error('MESON_SKIP_TEST Test does not make sense for cross builds')
+endif
+
+dep_zlib = dependency('zlib', required : false)
+if not dep_zlib.found()
+ error('MESON_SKIP_TEST Test requires zlib')
+endif
+dependency('zlib', native : true, required : false)
+dependency('zlib', native : false)
+
+# `native: true` should not make a difference when doing a native build.
+meson.override_dependency('expat', declare_dependency())
+dependency('expat')
+dependency('expat', native : true)
+dependency('expat', native : false)
diff --git a/meson/test cases/common/240 dependency native host == build/test.json b/meson/test cases/common/240 dependency native host == build/test.json
new file mode 100644
index 000000000..5e2a715e3
--- /dev/null
+++ b/meson/test cases/common/240 dependency native host == build/test.json
@@ -0,0 +1,14 @@
+{
+ "stdout": [
+ {
+ "line": "Dependency zlib found: YES .* \\(cached\\)",
+ "match": "re",
+ "count": 2
+ },
+ {
+ "line": "Dependency expat found: YES .* \\(overridden\\)",
+ "match": "re",
+ "count": 3
+ }
+ ]
+}