diff options
author | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2011-06-06 14:31:16 +0000 |
---|---|---|
committer | Jasper Lievisse Adriaanse <jasper@cvs.openbsd.org> | 2011-06-06 14:31:16 +0000 |
commit | ba0232284d13e0b08579e53f177f9c8ada5453a3 (patch) | |
tree | 6551f1934dfa6bf5304551c639a6bf0cfab2fa63 /regress/usr.bin/pkg-config | |
parent | f5ff5aa525b68ef8b472ef71a7cfb7de718880f0 (diff) |
- add some more tests for printing stuff about the pkgconfig files
- tidy Makefile
Diffstat (limited to 'regress/usr.bin/pkg-config')
-rw-r--r-- | regress/usr.bin/pkg-config/Makefile | 78 | ||||
-rw-r--r-- | regress/usr.bin/pkg-config/pcdir/print-provides.pc | 3 | ||||
-rw-r--r-- | regress/usr.bin/pkg-config/pcdir/print-req.pc | 4 | ||||
-rw-r--r-- | regress/usr.bin/pkg-config/pcdir/print-req2.pc | 4 |
4 files changed, 58 insertions, 31 deletions
diff --git a/regress/usr.bin/pkg-config/Makefile b/regress/usr.bin/pkg-config/Makefile index f30d2966863..699326b338c 100644 --- a/regress/usr.bin/pkg-config/Makefile +++ b/regress/usr.bin/pkg-config/Makefile @@ -1,10 +1,51 @@ -# $OpenBSD: Makefile,v 1.1 2011/06/06 13:58:03 jasper Exp $ +# $OpenBSD: Makefile,v 1.2 2011/06/06 14:31:15 jasper Exp $ #REGRESS_TARGETS=cmp-vers1 cmp-vers2 cmp-vers3 cmp-vers4 cmp-vers5 cmp-vers6 \ -# sysroot builddir define-variable print-provides print-req \ -# print-req-priv corrupt1 corrupt2 -REGRESS_TARGETS=corrupt1 corrupt2 print-req-priv +# sysroot builddir define-variable +REGRESS_TARGETS= corrupt1 \ + corrupt2 \ + print-provides \ + print-req \ + print-req-priv + +# Checks for corrupt pkg-config files. +corrupt1: + # Test for missing variables/fields + @echo "Package 'corrupt1' has no Version: field" > $@.want + @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ + --exists $@ 2> $@.got; then false; fi + @diff -u $@.want $@.got + +corrupt2: + # Test for missing variables/fields + @echo "Package 'corrupt2' has no Name: field" > $@.want + @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ + --exists $@ 2> $@.got; then false; fi + @diff -u $@.want $@.got + +# Checks for various printing features +print-provides: + # Test --print-provides + @echo "print-provides = 0.0.0" > $@.want + @PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ + --print-provides $@ > $@.got + @diff -u $@.want $@.got + +print-req: + # Test --print-requires + @echo "print-req2>=0.0.1" > $@.want + @PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ + --print-requires $@ > $@.got + @diff -u $@.want $@.got + +print-req-priv: + # Test --print-requires-private + @echo "print-req-priv2>=0.0.1" > $@.want + @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ + --print-requires-private $@ > $@.got; then false; fi + @diff -u $@.want $@.got +# Tests for version comparison cmp-vers1: # Test regular versions (a < b) @@ -23,42 +64,17 @@ cmp-vers5: cmp-vers6: # Test suffixed versions (rc) +# Tests for various environment variables sysroot: # Test PKG_CONFIG_SYSROOT_DIR builddir: # Test PKG_CONFIG_TOP_BUILD_DIR +# Misc. tests define-variable: # Test --define-variable -print-provides: - # Test --print-provides - -print-req: - # Test --print-requires - -print-req-priv: - # Test --print-requires-private - @echo "print-req-priv2>=0.0.1" > $@.want - @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ - --print-requires-private $@ > $@.got; then false; fi - @diff -u $@.want $@.got - -corrupt1: - # Test for missing variables/fields - @echo "Package 'corrupt1' has no Version: field" > $@.want - @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ - --exists $@ 2> $@.got; then false; fi - @diff -u $@.want $@.got - -corrupt2: - # Test for missing variables/fields - @echo "Package 'corrupt2' has no Name: field" > $@.want - @if PKG_CONFIG_PATH=${.CURDIR}/pcdir/ pkg-config \ - --exists $@ 2> $@.got; then false; fi - @diff -u $@.want $@.got - clean: rm -f *.want *.got diff --git a/regress/usr.bin/pkg-config/pcdir/print-provides.pc b/regress/usr.bin/pkg-config/pcdir/print-provides.pc new file mode 100644 index 00000000000..f707170a405 --- /dev/null +++ b/regress/usr.bin/pkg-config/pcdir/print-provides.pc @@ -0,0 +1,3 @@ +Name: print-provides +Description: pkg-config(1) regress file +Version: 0.0.0 diff --git a/regress/usr.bin/pkg-config/pcdir/print-req.pc b/regress/usr.bin/pkg-config/pcdir/print-req.pc new file mode 100644 index 00000000000..4ff302f2016 --- /dev/null +++ b/regress/usr.bin/pkg-config/pcdir/print-req.pc @@ -0,0 +1,4 @@ +Name: print-req +Description: pkg-config(1) regress file +Version: 0.0.0 +Requires: print-req2>=0.0.1 diff --git a/regress/usr.bin/pkg-config/pcdir/print-req2.pc b/regress/usr.bin/pkg-config/pcdir/print-req2.pc new file mode 100644 index 00000000000..d4ae7d341ba --- /dev/null +++ b/regress/usr.bin/pkg-config/pcdir/print-req2.pc @@ -0,0 +1,4 @@ +Name: print-req2 +Description: pkg-config(1) regress file +Version: 0.0.2 +Requires: |