From 0591c3702b83e11cee76bf938d082af8cde0e7c6 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Mon, 4 Feb 2019 18:53:20 +0000 Subject: add tests for recently added --validate --- regress/usr.bin/pkg-config/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'regress') 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} -- cgit v1.2.3