summaryrefslogtreecommitdiff
path: root/check/check-variable-override
diff options
context:
space:
mode:
Diffstat (limited to 'check/check-variable-override')
-rwxr-xr-xcheck/check-variable-override35
1 files changed, 35 insertions, 0 deletions
diff --git a/check/check-variable-override b/check/check-variable-override
new file mode 100755
index 0000000..e3f6cbd
--- /dev/null
+++ b/check/check-variable-override
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+set -e
+
+. ${srcdir}/common
+
+# Check the normal behavior
+RESULT="/usr"
+run_test --variable=prefix simple
+RESULT="/usr/lib"
+run_test --variable=libdir simple
+
+# Override prefix with correct environment variable
+export PKG_CONFIG_SIMPLE_PREFIX="/foo"
+RESULT="/foo"
+run_test --variable=prefix simple
+RESULT="/foo/lib"
+run_test --variable=libdir simple
+RESULT="-I/foo/include"
+run_test --cflags simple
+unset PKG_CONFIG_SIMPLE_PREFIX
+
+# Override prefix with incorrect environment variable case. On Windows
+# this will have no effect as environment variables are case
+# insensitive.
+if [ "$native_win32" != yes ]; then
+ export PKG_CONFIG_SIMPLE_prefix="/foo"
+ RESULT="/usr"
+ run_test --variable=prefix simple
+ RESULT="/usr/lib"
+ run_test --variable=libdir simple
+ RESULT=""
+ run_test --cflags simple
+ unset PKG_CONFIG_SIMPLE_prefix
+fi