diff options
author | dillo <dillo@pkgsrc.org> | 2005-06-02 20:38:51 +0000 |
---|---|---|
committer | dillo <dillo@pkgsrc.org> | 2005-06-02 20:38:51 +0000 |
commit | 788acb84cf902a7bf98f88e654a2e5a6f0f3e721 (patch) | |
tree | 83d76b54e63da656524276fb98e658cc0d73c00d /regress | |
parent | 7f874cf6f07300d76575b0659ba4f91501e571e0 (diff) | |
download | pkgsrc-788acb84cf902a7bf98f88e654a2e5a6f0f3e721.tar.gz |
add tests for groups of mutually exclusive options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/pkg-options/Makefile | 4 | ||||
-rw-r--r-- | regress/pkg-options/files/group-required.mk | 18 | ||||
-rw-r--r-- | regress/pkg-options/files/group-required.out | 1 | ||||
-rw-r--r-- | regress/pkg-options/files/groups.mk | 25 | ||||
-rw-r--r-- | regress/pkg-options/files/groups.out | 1 |
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 |