summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2009-03-30 20:49:17 +0200
committerTollef Fog Heen <tfheen@err.no>2009-03-30 20:49:17 +0200
commit669bfe2e0d5d761071a41bbbd771228b2b649187 (patch)
tree36e0730c2bda665bc6623be528ba97da954d733e /check
parent02d5ae3fb61c52f642d3b6b41973f12372fcdc60 (diff)
downloadpkg-config-669bfe2e0d5d761071a41bbbd771228b2b649187.tar.gz
2009-03-30 Tollef Fog Heen <tfheen@err.no>
* pkg.[ch], main.c, check/check-missing: Don't recurse Requires at all unless we need to. Add check. Again, thanks to Loïc Minier for most of the idea and the implementation.
Diffstat (limited to 'check')
-rw-r--r--check/Makefile.am3
-rwxr-xr-xcheck/check-missing26
-rw-r--r--check/missing-requires.pc12
3 files changed, 40 insertions, 1 deletions
diff --git a/check/Makefile.am b/check/Makefile.am
index 355f192..0728514 100644
--- a/check/Makefile.am
+++ b/check/Makefile.am
@@ -4,5 +4,6 @@ TESTS = check-cflags check-libs check-define-variable \
check-conflicts check-missing
EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \
- private-dep.pc includedir.pc missing-requires-private.pc
+ private-dep.pc includedir.pc missing-requires-private.pc \
+ missing-requires.pc
diff --git a/check/check-missing b/check/check-missing
index bd2650c..667de6c 100755
--- a/check/check-missing
+++ b/check/check-missing
@@ -50,3 +50,29 @@ ARGS="--variable includedir missing-requires-private"
EXPECT_RETURN=0
RESULT="/usr/include/somedir"
run_test
+
+# tests below are on an existing package, but with missing Requires; when
+# pkg-config outputs error, the actual error text isn't checked
+# package exists
+ARGS="missing-requires"
+EXPECT_RETURN=0
+RESULT=""
+run_test
+
+# Libs should fail
+ARGS="--silence-errors --libs missing-requires"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# Cflags should fail
+ARGS="--silence-errors --cflags missing-requires"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# get includedir var
+ARGS="--variable includedir missing-requires"
+EXPECT_RETURN=0
+RESULT="/usr/include/somedir"
+run_test
diff --git a/check/missing-requires.pc b/check/missing-requires.pc
new file mode 100644
index 0000000..755feb7
--- /dev/null
+++ b/check/missing-requires.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/somedir
+
+Name: Missing Requires test package
+Description: Dummy pkgconfig test package for testing with a missing Requires
+Version: 1.0.0
+Requires: pkg-non-existent-dep
+Libs: -L/missing-requires/lib -lmissing-requires
+Cflags: -I/missing-requires/include
+foodir: bar