summaryrefslogtreecommitdiff
path: root/regress/pkg-options/files
diff options
context:
space:
mode:
Diffstat (limited to 'regress/pkg-options/files')
-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
4 files changed, 45 insertions, 0 deletions
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