summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2019-02-04 18:53:20 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2019-02-04 18:53:20 +0000
commit0591c3702b83e11cee76bf938d082af8cde0e7c6 (patch)
tree60384289ffec3277bdb1b8931ed37889f42e14ce /regress
parent0ffd0472a316023ee9b7b2f98372d7e47962d6b9 (diff)
add tests for recently added --validate
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/pkg-config/Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/regress/usr.bin/pkg-config/Makefile b/regress/usr.bin/pkg-config/Makefile
index abb64ed13fe..408603b36b4 100644
--- a/regress/usr.bin/pkg-config/Makefile
+++ b/regress/usr.bin/pkg-config/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.59 2018/05/18 12:23:20 jasper Exp $
+# $OpenBSD: Makefile,v 1.60 2019/02/04 18:53:19 jasper Exp $
REGRESS_TARGETS=cmp-vers1-1 \
cmp-vers1-2 \
@@ -82,6 +82,9 @@ REGRESS_TARGETS=cmp-vers1-1 \
find-config-3 \
find-config-4 \
find-config-5 \
+ validate-1 \
+ validate-2 \
+ validate-3 \
variable-get-1 \
variable-set \
variables-1 \
@@ -568,6 +571,23 @@ find-config-5:
# Multiple existential tests combined (with space)
@${VPCONFIG} --exists vers1 vers2
+validate-1:
+ # Ensure it doesn't process dependencies
+ @${VPCONFIG} --validate missing-req
+
+validate-2:
+ # Test for empty files
+ @echo "Package file '${.CURDIR}/pcdir//corrupt3.pc' appears to be empty" > ${WANT}
+ @echo "Package 'corrupt3' has no Name: field" >> ${WANT}
+ @! ${VPCONFIG} --validate corrupt3
+ @diff -u ${WANT} ${GOT}
+
+validate-3:
+ # Test for missing fields
+ @echo "Package 'corrupt2' has no Name: field" > ${WANT}
+ @! ${VPCONFIG} --validate corrupt2
+ @diff -u ${WANT} ${GOT}
+
variable-get-1:
# Test --variable
@echo "/tmp" > ${WANT}