summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authordillo <dillo@pkgsrc.org>2005-06-02 20:38:51 +0000
committerdillo <dillo@pkgsrc.org>2005-06-02 20:38:51 +0000
commit0a9365175c5f3b5dfdc8d7ebc7e188a66c41e09b (patch)
tree83d76b54e63da656524276fb98e658cc0d73c00d /regress
parent35ffb4a048fb9768e291618727f808bdfdaa8bf5 (diff)
downloadpkgsrc-0a9365175c5f3b5dfdc8d7ebc7e188a66c41e09b.tar.gz
add tests for groups of mutually exclusive options
Diffstat (limited to 'regress')
-rw-r--r--regress/pkg-options/Makefile4
-rw-r--r--regress/pkg-options/files/group-required.mk18
-rw-r--r--regress/pkg-options/files/group-required.out1
-rw-r--r--regress/pkg-options/files/groups.mk25
-rw-r--r--regress/pkg-options/files/groups.out1
5 files changed, 47 insertions, 2 deletions
diff --git a/regress/pkg-options/Makefile b/regress/pkg-options/Makefile
index 127874567b8..f411d6d4ece 100644
--- a/regress/pkg-options/Makefile
+++ b/regress/pkg-options/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2005/05/31 11:05:31 dillo Exp $
+# $NetBSD: Makefile,v 1.5 2005/06/02 20:38:51 dillo Exp $
#
DISTNAME= regress-pkg-options-1.0
@@ -8,7 +8,7 @@ DISTFILES= # empty
MAINTAINER= rillig@NetBSD.org
COMMENT= Test bsd.options.mk framework
-REGRESS_TESTS= all legacy-opt order simple unsupported
+REGRESS_TESTS= all group-required groups legacy-opt order simple unsupported
do-test:
.for t in ${REGRESS_TESTS}
diff --git a/regress/pkg-options/files/group-required.mk b/regress/pkg-options/files/group-required.mk
new file mode 100644
index 00000000000..b998143e23e
--- /dev/null
+++ b/regress/pkg-options/files/group-required.mk
@@ -0,0 +1,18 @@
+# $NetBSD: group-required.mk,v 1.1 2005/06/02 20:38:51 dillo Exp $
+#
+# This file tests that selecting no option from a requried group
+# causes the package build to fail.
+#
+
+MAKECONF= /dev/null
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.unused
+PKG_SUPPORTED_OPTIONS= single
+PKG_OPTIONS_REQUIRED_GROUPS= req
+PKG_OPTIONS_GROUP.req= a b
+
+.include "../../mk/bsd.options.mk"
+
+.PHONY: test
+test:
+ echo ${PKG_FAIL_REASON:Q}
diff --git a/regress/pkg-options/files/group-required.out b/regress/pkg-options/files/group-required.out
new file mode 100644
index 00000000000..b813dc37ca4
--- /dev/null
+++ b/regress/pkg-options/files/group-required.out
@@ -0,0 +1 @@
+"One of the following options must be selected: "a\ b
diff --git a/regress/pkg-options/files/groups.mk b/regress/pkg-options/files/groups.mk
new file mode 100644
index 00000000000..16b2a65c14d
--- /dev/null
+++ b/regress/pkg-options/files/groups.mk
@@ -0,0 +1,25 @@
+# $NetBSD: groups.mk,v 1.1 2005/06/02 20:38:51 dillo Exp $
+#
+# This file tests option groups (PKG_OPTIONS_REQUIRED_GROUPS and
+# PKG_OPTIONS_OPTIONAL_GROUPS).
+#
+
+MAKECONF= /dev/null
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.foo
+PKG_SUPPORTED_OPTIONS= single
+PKG_OPTIONS_REQUIRED_GROUPS= abc def
+PKG_OPTIONS_OPTIONAL_GROUPS= ghi
+PKG_OPTIONS_GROUP.abc= a b c
+PKG_OPTIONS_GROUP.def= d e f
+PKG_OPTIONS_GROUP.ghi= g h i
+
+PKG_OPTIONS.foo= a b -a
+PKG_OPTIONS.foo+= d e f
+PKG_OPTIONS.foo+= g h i -i -h
+
+.include "../../mk/bsd.options.mk"
+
+.PHONY: test
+test:
+ echo ${PKG_OPTIONS:M*:Q}
diff --git a/regress/pkg-options/files/groups.out b/regress/pkg-options/files/groups.out
new file mode 100644
index 00000000000..75860503297
--- /dev/null
+++ b/regress/pkg-options/files/groups.out
@@ -0,0 +1 @@
+b f g