From b31e2ad6356f4b49872acba39ab40d32c3f2377c Mon Sep 17 00:00:00 2001 From: cube Date: Tue, 4 Oct 2005 13:44:23 +0000 Subject: [PATCH] Add a test, POSTPONED_ORPHAN, that should fail (although it currently does not). Rework the Makefile magic to have failing and succeeding tests. POSTPONED_ORPHAN is an example of a configuration where the user starts negating an instance, and then adding an instance of a child of the negated one. The latter should be found as an erroneous orphan, as the parent was negated beforewards. --- regress/usr.bin/config/Makefile | 26 +++++++++++++++++++++---- regress/usr.bin/config/POSTPONED_ORPHAN | 21 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 regress/usr.bin/config/POSTPONED_ORPHAN diff --git a/regress/usr.bin/config/Makefile b/regress/usr.bin/config/Makefile index 7899935c5d91..482a160b726f 100644 --- a/regress/usr.bin/config/Makefile +++ b/regress/usr.bin/config/Makefile @@ -1,9 +1,14 @@ -# $NetBSD: Makefile,v 1.1 2005/10/02 21:27:02 cube Exp $ +# $NetBSD: Makefile,v 1.2 2005/10/04 13:44:23 cube Exp $ # Those configurations only have to be understood by config(1) without # errors. -SIMPLE= SHADOW_INSTANCE +SIMPLE_SUCCESS= SHADOW_INSTANCE +SIMPLE_FAILURE= POSTPONED_ORPHAN + +SIMPLE= ${SIMPLE_SUCCESS} ${SIMPLE_FAILURE} + +CONFIG_OPTS.POSTPONED_ORPHAN= -v .include @@ -22,10 +27,23 @@ clean: ${__conf__}-clean .endfor .for __conf__ in ${SIMPLE} + +.if !empty(SIMPLE_SUCCESS:M${__conf__}) +CONFIG_TEST.${__conf__}= && echo "Test passed." +.else +CONFIG_TEST.${__conf__}= || echo "Test passed." +.endif + +CONFIG_LINE.${__conf__}= ${TOOL_CONFIG} ${CONFIG_OPTS.${__conf__}} \ + -s ${.CURDIR}/support \ + -b ./compile/${__conf__} ${.CURDIR}/${__conf__} \ + ${CONFIG_TEST.${__conf__}} + .PHONY: ${__conf__}-regress ${__conf__}-clean + ${__conf__}-regress: - @mkdir compile/${__conf__} - ${TOOL_CONFIG} -s ${.CURDIR}/support -b ./compile/${__conf__} ${.CURDIR}/${__conf__} + @mkdir -p compile/${__conf__} + ${CONFIG_LINE.${__conf__}} ${__conf__}-clean: @if [ -d compile/${__conf__} ]; then rm -Rf compile/${__conf__}; fi diff --git a/regress/usr.bin/config/POSTPONED_ORPHAN b/regress/usr.bin/config/POSTPONED_ORPHAN new file mode 100644 index 000000000000..bb5ec0461140 --- /dev/null +++ b/regress/usr.bin/config/POSTPONED_ORPHAN @@ -0,0 +1,21 @@ +include "arch/regress/conf/std.regress" + +maxusers 4 + +file-system REGRESSFS + +master0 at root + +parenti* at master? + +# Here, parenti is negated before the child* instance is declared. That +# means the child* instance does not qualify as an explicit orphan and +# therefore should _not_ be ignored. +# +# config(1) should error out on that config file. + +no parenti + +child* at parenti? + +config regress root on ?