summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
Diffstat (limited to 'check')
-rw-r--r--check/Makefile.am4
-rwxr-xr-xcheck/check-missing52
-rw-r--r--check/missing-requires-private.pc12
3 files changed, 66 insertions, 2 deletions
diff --git a/check/Makefile.am b/check/Makefile.am
index 772c8ad..355f192 100644
--- a/check/Makefile.am
+++ b/check/Makefile.am
@@ -1,8 +1,8 @@
TESTS = check-cflags check-libs check-define-variable \
check-libs-private check-requires-private check-includedir \
- check-conflicts
+ check-conflicts check-missing
EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \
- private-dep.pc includedir.pc
+ private-dep.pc includedir.pc missing-requires-private.pc
diff --git a/check/check-missing b/check/check-missing
new file mode 100755
index 0000000..bd2650c
--- /dev/null
+++ b/check/check-missing
@@ -0,0 +1,52 @@
+#! /bin/sh
+
+# Make sure we're POSIX
+if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
+ PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
+fi
+
+. ${srcdir}/common
+
+# non-existent package; call should fail and cause no output
+EXPECT_RETURN=1
+RESULT=""
+ARGS="pkg-non-existent"
+run_test
+
+# tests below are on an existing package, but with missing Requires.private;
+# when pkg-config outputs error, the actual error text isn't checked
+# package exists
+ARGS="missing-requires-private"
+EXPECT_RETURN=0
+RESULT=""
+run_test
+
+# get Libs
+ARGS="--libs missing-requires-private"
+EXPECT_RETURN=0
+RESULT="-L/missing-requires-private/lib -lmissing-requires-private"
+run_test
+
+# Libs.private should fail (verbosely, but the output isn't verified)
+ARGS="--silence-errors --static --libs missing-requires-private"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# Cflags.private should fail (verbosely, but the output isn't verified)
+ARGS="--silence-errors --static --cflags missing-requires-private"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# Cflags should fail (verbosely, but the output isn't verified)
+ARGS="--silence-errors --cflags missing-requires-private"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# get includedir var
+ARGS="--variable includedir missing-requires-private"
+EXPECT_RETURN=0
+RESULT="/usr/include/somedir"
+run_test
diff --git a/check/missing-requires-private.pc b/check/missing-requires-private.pc
new file mode 100644
index 0000000..171c866
--- /dev/null
+++ b/check/missing-requires-private.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/somedir
+
+Name: Missing Requires.private test package
+Description: Dummy package for testing with a missing Requires.private
+Version: 1.0.0
+Requires.private: pkg-non-existent-private-dep
+Libs: -L/missing-requires-private/lib -lmissing-requires-private
+Cflags: -I/missing-requires-private/include
+foodir: bar