diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2011-06-06 20:49:27 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2011-06-06 20:49:27 +0000 |
commit | c421a9a9b7332cc9eada600723da31b648857731 (patch) | |
tree | d854ada396f5aaa51a646b201b4a290dc90dd3f9 /regress/usr.bin | |
parent | 858053f86e1a44054353f429dc7039f3e29bf520 (diff) |
add failing tests for whitespace and Requires abuse
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/pkg-config/Makefile | 41 | ||||
-rw-r--r-- | regress/usr.bin/pkg-config/pcdir/missing-req.pc | 7 | ||||
-rw-r--r-- | regress/usr.bin/pkg-config/pcdir/whitespace.pc | 10 |
3 files changed, 57 insertions, 1 deletions
diff --git a/regress/usr.bin/pkg-config/Makefile b/regress/usr.bin/pkg-config/Makefile index 7b61c8799b9..cfa535510fd 100644 --- a/regress/usr.bin/pkg-config/Makefile +++ b/regress/usr.bin/pkg-config/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2011/06/06 18:59:44 jasper Exp $ +# $OpenBSD: Makefile,v 1.8 2011/06/06 20:49:26 jasper Exp $ REGRESS_TARGETS=cmp-vers1-1 \ cmp-vers1-2 \ @@ -131,6 +131,45 @@ sysroot-libs: define-variable: # Test --define-variable +# This fails as we read and check Requires as well as Requires.private where +# only Requires needs to be checked here. +# XXX: Test Requires.private too. +missing-req-1: + # Test for missing packages in Requires (libs) + @echo "Package nonexisting was not found in the pkg-config search path" > ${WANT} + @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config --libs \ + missing-req 2> ${GOT}; then false; fi + @diff -u ${WANT} ${GOT} + +missing-req-2: + # Test for missing packages in Requires (cflags) + @echo "Package nonexisting was not found in the pkg-config search path" > ${WANT} + @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config --cflags \ + missing-req 2> ${GOT}; then false; fi + @diff -u ${WANT} ${GOT} + +# This currently fails, because eventhough we only request the version +# '1' is still being set as return value +missing-req-3: + @echo "0.0.0" > ${WANT} + @PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config --modversion \ + missing-req > ${GOT} + @diff -u ${WANT} ${GOT} + +whitespace-cflags: + # Test whitespace on various positions in Cflags + @echo "-I/tmp/include -I/tmp/include/include\ dir" > ${WANT} + @PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config --cflags \ + whitespace > ${GOT} + @diff -u ${WANT} ${GOT} + +whitespace-libs: + # Test whitespace on various positions in Libs + @echo "-L/tmp/lib -L/tmp/lib/foo -lbaz\ quux" > ${WANT} + @PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config --libs \ + whitespace > ${GOT} + @diff -u ${WANT} ${GOT} + clean: rm -f *.want *.got diff --git a/regress/usr.bin/pkg-config/pcdir/missing-req.pc b/regress/usr.bin/pkg-config/pcdir/missing-req.pc new file mode 100644 index 00000000000..6be46b122ab --- /dev/null +++ b/regress/usr.bin/pkg-config/pcdir/missing-req.pc @@ -0,0 +1,7 @@ +Name: Bogus Requires(.private) +Description: pkg-config(1) regress file +Version: 0.0.0 +Requires: nonexisting +Requires.private: nonexisting2 +Libs: -L/missing-libdir/lib -lmissing-requires +Cflags: -I/missing-includdir/include diff --git a/regress/usr.bin/pkg-config/pcdir/whitespace.pc b/regress/usr.bin/pkg-config/pcdir/whitespace.pc new file mode 100644 index 00000000000..9e79ab80bfb --- /dev/null +++ b/regress/usr.bin/pkg-config/pcdir/whitespace.pc @@ -0,0 +1,10 @@ +prefix=/tmp +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: whitespace +Description: pkg-config(1) regress file +Version: 0.0.0 +Libs: -L${libdir} -L${libdir}/foo -lbaz\ quux +Cflags: -I${includedir} -I${includedir}/include\ dir |