summaryrefslogtreecommitdiffstats
path: root/test cases/unit/45 native dep pkgconfig var
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/unit/45 native dep pkgconfig var')
-rwxr-xr-xtest cases/unit/45 native dep pkgconfig var/cross_pkgconfig.py12
-rw-r--r--test cases/unit/45 native dep pkgconfig var/cross_pkgconfig/dep_tester.pc5
-rw-r--r--test cases/unit/45 native dep pkgconfig var/meson.build15
-rw-r--r--test cases/unit/45 native dep pkgconfig var/meson_options.txt6
-rw-r--r--test cases/unit/45 native dep pkgconfig var/native_pkgconfig/dep_tester.pc5
5 files changed, 43 insertions, 0 deletions
diff --git a/test cases/unit/45 native dep pkgconfig var/cross_pkgconfig.py b/test cases/unit/45 native dep pkgconfig var/cross_pkgconfig.py
new file mode 100755
index 0000000..f0d89ee
--- /dev/null
+++ b/test cases/unit/45 native dep pkgconfig var/cross_pkgconfig.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import subprocess
+
+environ = os.environ.copy()
+environ['PKG_CONFIG_LIBDIR'] = os.path.join(
+ os.path.dirname(os.path.realpath(__file__)), 'cross_pkgconfig')
+
+sys.exit(
+ subprocess.run(['pkg-config'] + sys.argv[1:], env=environ).returncode)
diff --git a/test cases/unit/45 native dep pkgconfig var/cross_pkgconfig/dep_tester.pc b/test cases/unit/45 native dep pkgconfig var/cross_pkgconfig/dep_tester.pc
new file mode 100644
index 0000000..67d7afa
--- /dev/null
+++ b/test cases/unit/45 native dep pkgconfig var/cross_pkgconfig/dep_tester.pc
@@ -0,0 +1,5 @@
+dep_type=cross
+
+Name: dependency() test
+Description: dependency() test
+Version: 0
diff --git a/test cases/unit/45 native dep pkgconfig var/meson.build b/test cases/unit/45 native dep pkgconfig var/meson.build
new file mode 100644
index 0000000..d95dbcd
--- /dev/null
+++ b/test cases/unit/45 native dep pkgconfig var/meson.build
@@ -0,0 +1,15 @@
+project('native dep pkgconfig test')
+
+if get_option('start_native')
+ dep_native = dependency('dep_tester', native: true, method: 'pkg-config')
+ dep_cross = dependency('dep_tester', native: false, method: 'pkg-config')
+else
+ dep_cross = dependency('dep_tester', native: false, method: 'pkg-config')
+ dep_native = dependency('dep_tester', native: true, method: 'pkg-config')
+endif
+
+dep_type = dep_native.get_pkgconfig_variable('dep_type')
+assert(dep_type == 'native', 'Expected native')
+
+dep_type = dep_cross.get_pkgconfig_variable('dep_type')
+assert(dep_type == 'cross', 'Expected cross')
diff --git a/test cases/unit/45 native dep pkgconfig var/meson_options.txt b/test cases/unit/45 native dep pkgconfig var/meson_options.txt
new file mode 100644
index 0000000..37006dd
--- /dev/null
+++ b/test cases/unit/45 native dep pkgconfig var/meson_options.txt
@@ -0,0 +1,6 @@
+option(
+ 'start_native',
+ type : 'boolean',
+ value : 'false',
+ description : 'Start by creating a dependency() with native : true',
+)
diff --git a/test cases/unit/45 native dep pkgconfig var/native_pkgconfig/dep_tester.pc b/test cases/unit/45 native dep pkgconfig var/native_pkgconfig/dep_tester.pc
new file mode 100644
index 0000000..affaa97
--- /dev/null
+++ b/test cases/unit/45 native dep pkgconfig var/native_pkgconfig/dep_tester.pc
@@ -0,0 +1,5 @@
+dep_type=native
+
+Name: dependency() test
+Description: dependency() test
+Version: 0