head	1.34;
access;
symbols
	RELENG_8_4:1.34.0.2
	RELENG_9_1_0_RELEASE:1.30.2.1.4.2
	RELENG_9_1:1.30.2.1.0.4
	RELENG_9_1_BP:1.30.2.1
	RELENG_8_3_0_RELEASE:1.29.10.1.8.1
	RELENG_8_3:1.29.10.1.0.8
	RELENG_8_3_BP:1.29.10.1
	RELENG_9_0_0_RELEASE:1.30.2.1.2.1
	RELENG_9_0:1.30.2.1.0.2
	RELENG_9_0_BP:1.30.2.1
	RELENG_9:1.30.0.2
	RELENG_9_BP:1.30
	RELENG_7_4_0_RELEASE:1.29.14.1
	RELENG_8_2_0_RELEASE:1.29.10.1.6.1
	RELENG_7_4:1.29.0.14
	RELENG_7_4_BP:1.29
	RELENG_8_2:1.29.10.1.0.6
	RELENG_8_2_BP:1.29.10.1
	RELENG_8_1_0_RELEASE:1.29.10.1.4.1
	RELENG_8_1:1.29.10.1.0.4
	RELENG_8_1_BP:1.29.10.1
	RELENG_7_3_0_RELEASE:1.29.12.1
	RELENG_7_3:1.29.0.12
	RELENG_7_3_BP:1.29
	RELENG_8_0_0_RELEASE:1.29.10.1.2.1
	RELENG_8_0:1.29.10.1.0.2
	RELENG_8_0_BP:1.29.10.1
	RELENG_8:1.29.0.10
	RELENG_8_BP:1.29
	RELENG_7_2_0_RELEASE:1.29.8.1
	RELENG_7_2:1.29.0.8
	RELENG_7_2_BP:1.29
	RELENG_7_1_0_RELEASE:1.29.6.1
	RELENG_6_4_0_RELEASE:1.28.12.1
	RELENG_7_1:1.29.0.6
	RELENG_7_1_BP:1.29
	RELENG_6_4:1.28.0.12
	RELENG_6_4_BP:1.28
	RELENG_7_0_0_RELEASE:1.29
	RELENG_6_3_0_RELEASE:1.28
	RELENG_7_0:1.29.0.4
	RELENG_7_0_BP:1.29
	RELENG_6_3:1.28.0.10
	RELENG_6_3_BP:1.28
	RELENG_7:1.29.0.2
	RELENG_7_BP:1.29
	RELENG_6_2_0_RELEASE:1.28
	RELENG_6_2:1.28.0.8
	RELENG_6_2_BP:1.28
	RELENG_6_1_0_RELEASE:1.28
	RELENG_6_1:1.28.0.6
	RELENG_6_1_BP:1.28
	RELENG_6_0_0_RELEASE:1.28
	RELENG_6_0:1.28.0.4
	RELENG_6_0_BP:1.28
	RELENG_6:1.28.0.2
	RELENG_6_BP:1.28
	old_old_RELENG_5_3_0_RELEASE:1.20
	old_old_RELENG_5_3:1.20.0.4
	old_old_RELENG_5_3_BP:1.20
	old_old_RELENG_5:1.20.0.2
	old_old_RELENG_5_BP:1.20
	old_old_RELENG_5_2_1_RELEASE:1.13
	old_old_RELENG_5_2_0_RELEASE:1.13
	old_old_RELENG_5_2:1.13.0.2
	old_old_RELENG_5_2_BP:1.13
	old_old_RELENG_5_1_0_RELEASE:1.11
	old_old_RELENG_5_1:1.11.0.2
	old_old_RELENG_5_1_BP:1.11
	old_old_RELENG_5_0_0_RELEASE:1.10
	old_old_RELENG_5_0:1.10.0.2
	old_old_RELENG_5_0_BP:1.10;
locks; strict;
comment	@# @;


1.34
date	2013.01.09.00.31.51;	author svnexp;	state Exp;
branches
	1.34.2.1;
next	1.33;

1.33
date	2012.11.17.01.53.37;	author svnexp;	state Exp;
branches;
next	1.32;

1.32
date	2012.10.06.20.01.05;	author marcel;	state Exp;
branches;
next	1.31;

1.31
date	2012.07.05.18.23.36;	author obrien;	state Exp;
branches;
next	1.30;

1.30
date	2011.05.25.23.33.49;	author obrien;	state Exp;
branches
	1.30.2.1;
next	1.29;

1.29
date	2007.10.01.18.09.42;	author ru;	state Exp;
branches
	1.29.2.1
	1.29.6.1
	1.29.8.1
	1.29.10.1
	1.29.12.1
	1.29.14.1;
next	1.28;

1.28
date	2005.03.02.12.33.22;	author harti;	state Exp;
branches
	1.28.2.1
	1.28.12.1;
next	1.27;

1.27
date	2004.12.07.14.41.16;	author harti;	state Exp;
branches;
next	1.26;

1.26
date	2004.12.06.08.51.30;	author ru;	state Exp;
branches;
next	1.25;

1.25
date	2004.12.02.17.00.58;	author harti;	state Exp;
branches;
next	1.24;

1.24
date	2004.11.30.15.33.18;	author harti;	state Exp;
branches;
next	1.23;

1.23
date	2004.11.25.10.03.29;	author harti;	state Exp;
branches;
next	1.22;

1.22
date	2004.11.11.19.47.54;	author nik;	state Exp;
branches;
next	1.21;

1.21
date	2004.10.23.21.38.58;	author ru;	state Exp;
branches;
next	1.20;

1.20
date	2004.08.12.19.14.10;	author harti;	state Exp;
branches;
next	1.19;

1.19
date	2004.08.05.09.11.44;	author harti;	state Exp;
branches;
next	1.18;

1.18
date	2004.08.05.08.44.00;	author harti;	state Exp;
branches;
next	1.17;

1.17
date	2004.08.05.07.24.06;	author harti;	state Exp;
branches;
next	1.16;

1.16
date	2004.08.04.07.40.58;	author harti;	state Exp;
branches;
next	1.15;

1.15
date	2004.01.30.09.46.28;	author ru;	state Exp;
branches;
next	1.14;

1.14
date	2004.01.29.22.51.36;	author ru;	state Exp;
branches;
next	1.13;

1.13
date	2003.10.02.21.30.30;	author ru;	state Exp;
branches;
next	1.12;

1.12
date	2003.07.04.13.33.48;	author ru;	state Exp;
branches;
next	1.11;

1.11
date	2003.02.10.19.56.42;	author gad;	state Exp;
branches;
next	1.10;

1.10
date	2002.11.28.13.21.32;	author ru;	state Exp;
branches;
next	1.9;

1.9
date	2002.11.28.13.08.09;	author ru;	state Exp;
branches;
next	1.8;

1.8
date	2002.10.25.06.17.44;	author jmallett;	state Exp;
branches;
next	1.7;

1.7
date	2002.07.28.03.57.08;	author jmallett;	state Exp;
branches;
next	1.6;

1.6
date	2002.06.20.03.08.20;	author jmallett;	state Exp;
branches;
next	1.5;

1.5
date	2002.06.19.18.57.04;	author jmallett;	state Exp;
branches;
next	1.4;

1.4
date	2002.05.05.19.02.30;	author jmallett;	state Exp;
branches;
next	1.3;

1.3
date	2002.04.27.02.26.22;	author jmallett;	state Exp;
branches;
next	1.2;

1.2
date	2002.04.21.00.41.37;	author jmallett;	state Exp;
branches;
next	1.1;

1.1
date	2002.04.20.20.57.00;	author jmallett;	state Exp;
branches;
next	;

1.34.2.1
date	2013.01.09.00.31.51;	author svnexp;	state dead;
branches;
next	1.34.2.2;

1.34.2.2
date	2013.03.28.13.05.46;	author svnexp;	state Exp;
branches;
next	;

1.30.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.30.2.1.2.1
	1.30.2.1.4.1;
next	1.30.2.2;

1.30.2.2
date	2012.11.17.11.37.27;	author svnexp;	state Exp;
branches;
next	;

1.30.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.30.2.1.2.2;

1.30.2.1.2.2
date	2012.11.17.08.37.24;	author svnexp;	state Exp;
branches;
next	;

1.30.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.30.2.1.4.2;

1.30.2.1.4.2
date	2012.11.17.08.48.15;	author svnexp;	state Exp;
branches;
next	;

1.29.2.1
date	2012.11.17.08.07.50;	author svnexp;	state Exp;
branches;
next	;

1.29.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.29.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.29.10.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.29.10.1.2.1
	1.29.10.1.4.1
	1.29.10.1.6.1
	1.29.10.1.8.1;
next	1.29.10.2;

1.29.10.2
date	2012.11.17.10.37.08;	author svnexp;	state Exp;
branches;
next	;

1.29.10.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.29.10.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.29.10.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.29.10.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.29.10.1.8.2;

1.29.10.1.8.2
date	2012.11.17.08.25.43;	author svnexp;	state Exp;
branches;
next	;

1.29.12.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.29.14.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.29.14.2;

1.29.14.2
date	2012.11.17.08.17.37;	author svnexp;	state Exp;
branches;
next	;

1.28.2.1
date	2012.11.17.07.45.17;	author svnexp;	state Exp;
branches;
next	;

1.28.12.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;


desc
@@


1.34
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/245171
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@# $FreeBSD: head/tools/build/make_check/Makefile 245171 2013-01-08 18:37:12Z obrien $

.MAKE.MODE=	normal

# Test for broken LHS expansion.
# This *must* cause make(1) to detect a recursive variable, and fail as such.
.if make(lhs_expn)
FOO=		${BAR}
BAR${NIL}=	${FOO}
FOO${BAR}=	${FOO}
.endif

DATA1=	helllo
DATA2:=	${DATA1}
DATA3=	${DATA2:S/ll/rr/g}
DATA4:=	${DATA2:S/ll/rr/g}
DATA2?=	allo
DATA5:= ${DATA2:S/ll/ii/g} ${DATA1:S/ll/rr/g}
DATA2=	yello
DATA1:=	${DATA5:S/l/r/g}
NIL=

SMAKE=	MAKEFLAGS= ${MAKE} -C ${.CURDIR}

all:
	@@echo '1..16'
	@@${SMAKE} C_check || { ${MAKE} -C ${.CURDIR} failure ; }
	@@echo "ok 1 - C_check # Test of -C flag existence detected no regression."
	@@echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \
		diff -u ${.CURDIR}/regress.variables.out - || \
		${SMAKE} failure
	@@echo "ok 2 - test_variables # Test variables detected no regression, output matches."
	@@${SMAKE} double 2>/dev/null || ${SMAKE} failure
	@@echo "ok 3 - test_targets # Test targets detected no regression."
	@@${SMAKE} sysvmatch || ${SMAKE} failure
	@@echo "ok 4 - sysvmatch # Test sysvmatch detected no regression."
	@@! ${SMAKE} lhs_expn && true || ${SMAKE} failure
	@@echo "ok 5 lhs_expn # Test lhs_expn detected no regression."
	@@${SMAKE} notdef || ${SMAKE} failure
	@@echo "ok 6 - notdef # Test notdef detected no regression."
	@@${SMAKE} modifiers || ${SMAKE} failure
	@@echo "ok 7 - modifiers # Test modifiers detected no regression."
	@@${SMAKE} arith_expr || ${SMAKE} failure
	@@echo "ok 8 arith_expr # Test arith_expr detected no regression."
	@@${SMAKE} PATH_exists || ${SMAKE} failure
	@@echo "ok 9 PATH_exists # Test PATH_exists detected no regression."
	@@${SMAKE} double_quotes || ${SMAKE} failure
	@@echo "ok 10 double_quotes # Test double_quotes detected no regression."
	@@! ${SMAKE} double_quotes2 >/dev/null 2>&1 && true || ${SMAKE} failure
	@@echo "ok 11 double_quotes2 # Test double_quotes2 detected no regression."
	@@${SMAKE} pass_cmd_vars || ${SMAKE} failure
	@@echo "ok 12 pass_cmd_vars # Test pass_cmd_vars detected no regression."
	@@${SMAKE} plus_flag || ${SMAKE} failure
	@@echo "ok 13 plus_flag # Test plus_flag detected no regression."
	@@! ${SMAKE} shell >/dev/null 2>&1 && true || ${SMAKE} failure
	@@echo "ok 14 shell # Test shell detected no regression."
	@@${SMAKE} shell_1 || ${SMAKE} failure
	@@echo "ok 15 shell_1 # Test shell_1 detected no regression."
.if !defined(.PARSEDIR)
	@@${SMAKE} shell_2 || ${SMAKE} failure
	@@echo "ok 16 shell_2 # Test shell_2 detected no regression."
.endif

.if make(C_check)
C_check:
.endif

.if make(double)
# Doubly-defined targets.  make(1) will warn, but use the "right" one.  If it
# switches to using the "non-right" one, it breaks things worse than a little
# regression test.
double:
	@@true

double:
	@@false
.endif

.if make(sysvmatch)
# Some versions of FreeBSD make(1) do not handle a nil LHS in sysvsubst.
sysvmatch:
	@@echo EMPTY ${NIL:=foo} LHS | \
		diff -u ${.CURDIR}/regress.sysvmatch.out - || false
.endif

# A bogus target for the lhs_expn test;  If this is reached, then the make(1)
# program has not errored out because of the recursion caused by not expanding
# the left-hand-side's embedded variables above.
lhs_expn:
	@@true

.if make(notdef)
# make(1) claims to only evaluate a conditional as far as is necessary
# to determine its value; that was not always the case.
.undef notdef
notdef:
.if defined(notdef) && ${notdef:M/}
.endif
.endif

.if make(modifiers)
.if defined(.PARSEDIR)
# check if bmake can expand plain variables
.MAKE.EXPAND_VARIABLES= yes
x!= ${SMAKE} -V .CURDIR:H
modifiers:
.if ${.CURDIR:H} != "$x"
	@@false
.endif
.else
# See if make(1) supports the C modifier.
modifiers: dollarV
	@@if ${SMAKE} -V .CURDIR:C/.// 2>&1 >/dev/null | \
	    grep -q "Unknown modifier 'C'"; then \
		false; \
	fi

# check that make -V '${VAR}' works
V_expn != V_OK=ok ${SMAKE} -r -f /dev/null -V '$${V_OK}'
dollarV:
.if ${V_expn} == ""
	@@false
.endif
.endif
.endif

.if make(arith_expr)
arith_expr:
# See if arithmetic expression parsing is broken.
# The different spacing below is intentional.
VALUE=	0
.if (${VALUE} < 0)||(${VALUE}>0)
.endif
.endif

.if make(PATH_exists)
PATH_exists:
.PATH: ${.CURDIR}
.if !exists(${.CURDIR}/) || !exists(${.CURDIR}/.) || !exists(${.CURDIR}/..)
.error exists() failed
.endif
.endif

.if make(double_quotes)
VALUE=	foo ""
double_quotes:
.if ${VALUE:S/$//} != ${VALUE}
.error "" reduced to "
.endif
.endif

.if make(double_quotes2)
double_quotes2:
	@@cat /dev/null ""
.endif

#
# Check passing of variable via MAKEFLAGS
#
.if make(pass_cmd_vars)
pass_cmd_vars:
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_1
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_2
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_3
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_4
.endif

#
# Check that the variable definition arrived from the calling make
#
.if make(pass_cmd_vars_1)
# These values should get overridden by the commandline
CMD1=oops1
CMD2=oops2
pass_cmd_vars_1:
	@@:

.if ${CMD1} != cmd1 || ${CMD2} != cmd2
.error variables not passed through MAKEFLAGS
.endif
.endif

.if make(pass_cmd_vars_2)
# Check that we cannot override the passed variables
CMD1=foo1
CMD2=foo2

.if ${CMD1} != cmd1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables overridden
.endif

pass_cmd_vars_2:
	@@:
.endif

.if make(pass_cmd_vars_3)
# Check that we can override the passed variables on the next sub-make's
# command line

pass_cmd_vars_3:
	@@${SMAKE} CMD1=foo1 pass_cmd_vars_3_1
.endif

.if make(pass_cmd_vars_3_1)
.if ${CMD1} != foo1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables not overridden on command line
.endif
pass_cmd_vars_3_1:
	@@:
.endif

.if make(pass_cmd_vars_4)
# Ensure that a variable assignment passed via MAKEFLAGS may be overwritten
# by evaluating the .MAKEFLAGS target.

.MAKEFLAGS: CMD1=baz1

pass_cmd_vars_4:
	@@${SMAKE} pass_cmd_vars_4_1

.if ${CMD1} != baz1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables not overridden via .MAKEFLAGS target
.endif

.endif
.if make(pass_cmd_vars_4_1)
.if ${CMD1} != baz1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables not overridden via .MAKEFLAGS target (2)
.endif
pass_cmd_vars_4_1:
	@@:
.endif

#
# Test whether make supports the '+' flag (meaning: execute even with -n)
#
.if make(plus_flag)
OUT != ${SMAKE} -n plus_flag_1
.if ${OUT:M/tmp} != "/tmp"
.error make doesn't handle + flag
.endif
plus_flag:
	@@:
.endif
.if make(plus_flag_1)
plus_flag_1:
	+@@cd /tmp; pwd
.endif

.if make(shell)
# Test if make fully supports the .SHELL specification.
.SHELL: path=/nonexistent
A!= echo ok
shell:
.endif

.if make(shell_1)
# Test if setting the shell by name only works. Because we have no ksh
# in the base system we test that we can set sh and csh. We try only exact
# matching names and do not exercise the rather strange matching algorithm.
shell_1:
	@@${SMAKE} shell_1_csh
	@@${SMAKE} shell_1_sh
.endif
.if make(shell_1_csh)
.SHELL: name="csh"
shell_1_csh:
	@@ps -ax -opid,command | awk '$$1=="'$$$$'" { print $$2 }' | grep -E -q '^(/bin/)?csh$$'
.endif
.if make(shell_1_sh)
.SHELL: name="sh"
shell_1_sh:
	@@ps -ax -opid,command | awk '$$1=="'$$$$'" { print $$2 }' | grep -E -q '^(/bin/)?sh$$'
.endif

.if make(shell_2)
# Test if we can replace the shell specification. We do this by using
# a shell scripts that prints us its arguments and standard input as the shell
shell_2: shell_test
	@@${SMAKE} -B shell_2B | \
		diff -u ${.CURDIR}/regress.shell_2B.out - || false
	@@${SMAKE} -j1 shell_2j | \
		diff -u ${.CURDIR}/regress.shell_2j.out - || false
.endif

.if make(shell_2B)
.SHELL: name="echo" path="${.OBJDIR}/shell_test" quiet="be quiet" echo="be verbose" filter="be verbose" echoFlag="x" errFlag="y" hasErrCtl=y check="check errors" ignore="ignore errors"

shell_2B:
	-@@funny $$
	funnier $$
.endif

.if make(shell_2j)
.SHELL: name="echo" path="${.OBJDIR}/shell_test" quiet="be quiet" echo="be verbose" filter="be verbose" echoFlag="x" errFlag="y" hasErrCtl=y check="check errors" ignore="ignore errors"

shell_2j:
	-@@funny $$
	funnier $$
.endif

failure:
	@@echo "not ok # Test failed: regression detected.  See above."
	@@false

CLEANFILES= shell_test

.include <bsd.obj.mk>
@


1.34.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:05:46 +0000
@
text
@d1 308
@


1.34.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 300
# $FreeBSD: releng/8.4/tools/build/make_check/Makefile 172399 2007-10-01 18:09:42Z ru $

# Test for broken LHS expansion.
# This *must* cause make(1) to detect a recursive variable, and fail as such.
.if make(lhs_expn)
FOO=		${BAR}
BAR${NIL}=	${FOO}
FOO${BAR}=	${FOO}
.endif

DATA1=	helllo
DATA2:=	${DATA1}
DATA3=	${DATA2:S/ll/rr/g}
DATA4:=	${DATA2:S/ll/rr/g}
DATA2?=	allo
DATA5:= ${DATA2:S/ll/ii/g} ${DATA1:S/ll/rr/g}
DATA2=	yello
DATA1:=	${DATA5:S/l/r/g}
NIL=

SMAKE=	MAKEFLAGS= ${MAKE} -C ${.CURDIR}

all:
	@@echo '1..17'
	@@${SMAKE} C_check || { cd ${.CURDIR} ; ${MAKE} failure ; }
	@@echo "ok 1 - C_check # Test of -C flag existence detected no regression."
	@@echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \
		diff -u ${.CURDIR}/regress.variables.out - || \
		${SMAKE} failure
	@@echo "ok 2 - test_variables # Test variables detected no regression, output matches."
	@@${SMAKE} double 2>/dev/null || ${SMAKE} failure
	@@echo "ok 3 - test_targets # Test targets detected no regression."
	@@${SMAKE} sysvmatch || ${SMAKE} failure
	@@echo "ok 4 - sysvmatch # Test sysvmatch detected no regression."
	@@! ${SMAKE} lhs_expn && true || ${SMAKE} failure
	@@echo "ok 5 lhs_expn # Test lhs_expn detected no regression."
	@@${SMAKE} notdef || ${SMAKE} failure
	@@echo "ok 6 - notdef # Test notdef detected no regression."
	@@${SMAKE} modifiers || ${SMAKE} failure
	@@echo "ok 7 - modifiers # Test modifiers detected no regression."
	@@${SMAKE} funny_targets || ${SMAKE} failure
	@@echo "ok 8 funny_targets # Test funny_targets detected no regression."
	@@${SMAKE} arith_expr || ${SMAKE} failure
	@@echo "ok 9 arith_expr # Test arith_expr detected no regression."
	@@${SMAKE} PATH_exists || ${SMAKE} failure
	@@echo "ok 10 PATH_exists # Test PATH_exists detected no regression."
	@@${SMAKE} double_quotes || ${SMAKE} failure
	@@echo "ok 11 double_quotes # Test double_quotes detected no regression."
	@@! ${SMAKE} double_quotes2 >/dev/null 2>&1 && true || ${SMAKE} failure
	@@echo "ok 12 double_quotes2 # Test double_quotes2 detected no regression."
	@@${SMAKE} pass_cmd_vars || ${SMAKE} failure
	@@echo "ok 13 pass_cmd_vars # Test pass_cmd_vars detected no regression."
	@@${SMAKE} plus_flag || ${SMAKE} failure
	@@echo "ok 14 plus_flag # Test plus_flag detected no regression."
	@@! ${SMAKE} shell >/dev/null 2>&1 && true || ${SMAKE} failure
	@@echo "ok 15 shell # Test shell detected no regression."
	@@${SMAKE} shell_1 || ${SMAKE} failure
	@@echo "ok 16 shell_1 # Test shell_1 detected no regression."
	@@${SMAKE} shell_2 || ${SMAKE} failure
	@@echo "ok 17 shell_2 # Test shell_2 detected no regression."

.if make(C_check)
C_check:
.endif

.if make(double)
# Doubly-defined targets.  make(1) will warn, but use the "right" one.  If it
# switches to using the "non-right" one, it breaks things worse than a little
# regression test.
double:
	@@true

double:
	@@false
.endif

.if make(sysvmatch)
# Some versions of FreeBSD make(1) do not handle a nil LHS in sysvsubst.
sysvmatch:
	@@echo EMPTY ${NIL:=foo} LHS | \
		diff -u ${.CURDIR}/regress.sysvmatch.out - || false
.endif

# A bogus target for the lhs_expn test;  If this is reached, then the make(1)
# program has not errored out because of the recursion caused by not expanding
# the left-hand-side's embedded variables above.
lhs_expn:
	@@true

.if make(notdef)
# make(1) claims to only evaluate a conditional as far as is necessary
# to determine its value; that was not always the case.
.undef notdef
notdef:
.if defined(notdef) && ${notdef:U}
.endif
.endif

.if make(modifiers)
# See if make(1) supports the C modifier.
modifiers:
	@@if ${SMAKE} -V .CURDIR:C/.// 2>&1 >/dev/null | \
	    grep -q "Unknown modifier 'C'"; then \
		false; \
	fi
.endif

.if make(funny_targets)
funny_targets: colons::target exclamation!target
colons::target:
exclamation!target: 
.endif

.if make(arith_expr)
arith_expr:
# See if arithmetic expression parsing is broken.
# The different spacing below is intentional.
VALUE=	0
.if (${VALUE} < 0)||(${VALUE}>0)
.endif
.endif

.if make(PATH_exists)
PATH_exists:
.PATH: ${.CURDIR}
.if !exists(${.CURDIR}/) || !exists(${.CURDIR}/.) || !exists(${.CURDIR}/..)
.error exists() failed
.endif
.endif

.if make(double_quotes)
VALUE=	foo ""
double_quotes:
.if ${VALUE:S/$//} != ${VALUE}
.error "" reduced to "
.endif
.endif

.if make(double_quotes2)
double_quotes2:
	@@cat /dev/null ""
.endif

#
# Check passing of variable via MAKEFLAGS
#
.if make(pass_cmd_vars)
pass_cmd_vars:
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_1
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_2
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_3
	@@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_4
.endif

.if make(pass_cmd_vars_1)
# Check that the variable definition arrived from the calling make
pass_cmd_vars_1:
	@@:

.if ${CMD1} != cmd1 || ${CMD2} != cmd2
.error variables not passed through MAKEFLAGS
.endif

# Check that the variable definition is in MAKEFLAGS
.if ${.MAKEFLAGS:MCMD1=*} != "CMD1=cmd1" || ${.MAKEFLAGS:MCMD2=*} != "CMD2=cmd2"
.error variable assignment not found in $${MAKEFLAGS}
.endif

# Check that the variable definition is not in MFLAGS
.if ${MFLAGS:MCMD1=*} != "" || ${MFLAGS:MCMD2=*} != ""
.error variable assignment found in $${MFLAGS}
.endif
.endif

.if make(pass_cmd_vars_2)
# Check that we cannot override the passed variables
CMD1=foo1
CMD2=foo2

.if ${CMD1} != cmd1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables overridden
.endif

pass_cmd_vars_2:
	@@:
.endif

.if make(pass_cmd_vars_3)
# Check that we can override the passed variables on the next sub-make's
# command line

pass_cmd_vars_3:
	@@${SMAKE} CMD1=foo1 pass_cmd_vars_3_1
.endif

.if make(pass_cmd_vars_3_1)
.if ${CMD1} != foo1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables not overridden on command line
.endif
pass_cmd_vars_3_1:
	@@:
.endif

.if make(pass_cmd_vars_4)
# Ensure that a variable assignment passed via MAKEFLAGS may be overwritten
# by evaluating the .MAKEFLAGS target.

.MAKEFLAGS: CMD1=baz1

pass_cmd_vars_4:
	@@${SMAKE} pass_cmd_vars_4_1

.if ${CMD1} != baz1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables not overridden via .MAKEFLAGS target
.endif

.endif
.if make(pass_cmd_vars_4_1)
.if ${CMD1} != baz1 || ${CMD2} != cmd2
.error MAKEFLAGS-passed variables not overridden via .MAKEFLAGS target (2)
.endif
pass_cmd_vars_4_1:
	@@:
.endif

#
# Test whether make supports the '+' flag (meaning: execute even with -n)
#
.if make(plus_flag)
OUT != ${SMAKE} -n plus_flag_1
.if ${OUT} != "/tmp"
.error make doesn't handle + flag
.endif
plus_flag:
	@@:
.endif
.if make(plus_flag_1)
plus_flag_1:
	+@@cd /tmp; pwd
.endif

.if make(shell)
# Test if make fully supports the .SHELL specification.
.SHELL: path=/nonexistent
A!= echo ok
shell:
.endif

.if make(shell_1)
# Test if setting the shell by name only works. Because we have no ksh
# in the base system we test that we can set sh and csh. We try only exact
# matching names and do not exercise the rather strange matching algorithm.
shell_1:
	@@${SMAKE} shell_1_csh
	@@${SMAKE} shell_1_sh
.endif
.if make(shell_1_csh)
.SHELL: name="csh"
shell_1_csh:
	@@ps -ax -opid,command | awk '$$1=="'$$$$'" { print $$2 }' | grep -E -q '^(/bin/)?csh$$'
.endif
.if make(shell_1_sh)
.SHELL: name="sh"
shell_1_sh:
	@@ps -ax -opid,command | awk '$$1=="'$$$$'" { print $$2 }' | grep -E -q '^(/bin/)?sh$$'
.endif

.if make(shell_2)
# Test if we can replace the shell specification. We do this by using
# a shell scripts that prints us its arguments and standard input as the shell
shell_2: shell_test
	@@${SMAKE} -B shell_2B | \
		diff -u ${.CURDIR}/regress.shell_2B.out - || false
	@@${SMAKE} -j1 shell_2j | \
		diff -u ${.CURDIR}/regress.shell_2j.out - || false
.endif

.if make(shell_2B)
.SHELL: name="echo" path="${.OBJDIR}/shell_test" quiet="be quiet" echo="be verbose" filter="be verbose" echoFlag="x" errFlag="y" hasErrCtl=y check="check errors" ignore="ignore errors"

shell_2B:
	-@@funny $$
	funnier $$
.endif

.if make(shell_2j)
.SHELL: name="echo" path="${.OBJDIR}/shell_test" quiet="be quiet" echo="be verbose" filter="be verbose" echoFlag="x" errFlag="y" hasErrCtl=y check="check errors" ignore="ignore errors"

shell_2j:
	-@@funny $$
	funnier $$
.endif

failure:
	@@echo "not ok # Test failed: regression detected.  See above."
	@@false

CLEANFILES= shell_test

.include <bsd.obj.mk>
@


1.33
log
@Switching exporter and resync
@
text
@d1 1
a1 1
# $FreeBSD: head/tools/build/make_check/Makefile 241298 2012-10-06 20:01:05Z marcel $
d27 1
a27 1
	@@${SMAKE} C_check || { cd ${.CURDIR} ; ${MAKE} failure ; }
@


1.32
log
@SVN rev 241298 on 2012-10-06 20:01:05Z by marcel

Add support for bmake. This includes:
1.  Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
    there's a bootstrap complication in ths respect. Avoid it. Make the
    necessary changes to have upgrade_checks work wth bmake anyway.
2.  Remove the use of -E. It's not needed in our build because we use ?= for
    the respective variables, which means that we'll take the environment
    value (if any) anyway.
3.  Properly declare phony targets as phony as bmake is a lot smarter (and
    thus agressive) about build avoidance.
4.  Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
    smarter about build avoidance and should not find files we generate in
    the source tree. We should not have files in the repository we want to
    generate, but this is an easier way to cross this hurdle.
5.  Have behavior under bmake the same as it is under make with respect to
    halting when sub-commands fail. Add "set -e" to compound commands so
    that bmake is informed when sub-commands fail.
6.  Make sure crunchgen uses the same make as the rest of the build. This
    is important when the make utility isn't called make (but bmake for
    example).
7.  While here, add support for using MAKEOBJDIR to set the object tree
    location. It's the second alternative bmake looks for when determining
    the actual object directory (= .OBJDIR).

Submitted by:	Simon Gerraty <sjg@@juniper.net>
Submitted by:	John Van Horne <jvanhorne@@juniper.net>
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.31
log
@SVN rev 238143 on 2012-07-05 18:23:36Z by obrien

Remove the "funny targets" make check.  We no longer need embedded :: targets
to build FreeBSD (they are used in Perl man pages).  We never needed embedded
"!" in targets that I can find.

We got this from OpenBSD and I cannot find any other make that supports
such things -- contrary to their commit message claim: "This behaviour
is also consistent with other versions of make.".
@
text
@d59 1
d62 1
d97 1
a97 1
.if defined(notdef) && ${notdef:U}
d102 9
d112 1
a112 1
modifiers:
d117 8
@


1.30
log
@SVN rev 222295 on 2011-05-25 23:33:49Z by obrien

+ Tighten up (and simplify) the pass_cmd_vars_1 "variable definition arrived
  from the calling make" test.
+ Be more tolerant of newlines in the plus_flag "supports the '+' flag" test.
@
text
@d26 1
a26 1
	@@echo '1..17'
a42 2
	@@${SMAKE} funny_targets || ${SMAKE} failure
	@@echo "ok 8 funny_targets # Test funny_targets detected no regression."
d44 1
a44 1
	@@echo "ok 9 arith_expr # Test arith_expr detected no regression."
d46 1
a46 1
	@@echo "ok 10 PATH_exists # Test PATH_exists detected no regression."
d48 1
a48 1
	@@echo "ok 11 double_quotes # Test double_quotes detected no regression."
d50 1
a50 1
	@@echo "ok 12 double_quotes2 # Test double_quotes2 detected no regression."
d52 1
a52 1
	@@echo "ok 13 pass_cmd_vars # Test pass_cmd_vars detected no regression."
d54 1
a54 1
	@@echo "ok 14 plus_flag # Test plus_flag detected no regression."
d56 1
a56 1
	@@echo "ok 15 shell # Test shell detected no regression."
d58 1
a58 1
	@@echo "ok 16 shell_1 # Test shell_1 detected no regression."
d60 1
a60 1
	@@echo "ok 17 shell_2 # Test shell_2 detected no regression."
a107 6
.if make(funny_targets)
funny_targets: colons::target exclamation!target
colons::target:
exclamation!target: 
.endif

@


1.30.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.30.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/tools/build/make_check/Makefile 222295 2011-05-25 23:33:49Z obrien $
@


1.30.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.30.2.1.4.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/tools/build/make_check/Makefile 222295 2011-05-25 23:33:49Z obrien $
@


1.30.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.30.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/tools/build/make_check/Makefile 222295 2011-05-25 23:33:49Z obrien $
@


1.29
log
@The shell_1_sh test was failing with "make -jX".

Approved by:	re (kensmith)
@
text
@d3 2
d157 3
d161 3
a163 1
# Check that the variable definition arrived from the calling make
a169 10

# Check that the variable definition is in MAKEFLAGS
.if ${.MAKEFLAGS:MCMD1=*} != "CMD1=cmd1" || ${.MAKEFLAGS:MCMD2=*} != "CMD2=cmd2"
.error variable assignment not found in $${MAKEFLAGS}
.endif

# Check that the variable definition is not in MFLAGS
.if ${MFLAGS:MCMD1=*} != "" || ${MFLAGS:MCMD2=*} != ""
.error variable assignment found in $${MFLAGS}
.endif
d228 1
a228 1
.if ${OUT} != "/tmp"
@


1.29.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/tools/build/make_check/Makefile 172399 2007-10-01 18:09:42Z ru $
@


1.29.14.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.29.14.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/tools/build/make_check/Makefile 172399 2007-10-01 18:09:42Z ru $
@


1.29.12.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.29.10.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.29.10.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/tools/build/make_check/Makefile 172399 2007-10-01 18:09:42Z ru $
@


1.29.10.1.8.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.29.10.1.8.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/tools/build/make_check/Makefile 172399 2007-10-01 18:09:42Z ru $
@


1.29.10.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.29.10.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.29.10.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.29.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.29.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.28
log
@Repo-copy tools/regression/usr.bin/make to tools/build/make_check
and adjust the path in the Makefile for the upgrade_checks target.
These checks are really feature upgrade checks that should be fast
and just find out whether we need to build a new make before
proceeding with other targets like buildworld. This makes the
place free for a real regression test suite in the old place.
@
text
@d265 1
a265 1
	@@ps -ax -opid,command | awk '$$1=="'$$$$'" { print $$2 }' | grep -q '^/bin/sh$$'
@


1.28.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/tools/build/make_check/Makefile 143032 2005-03-02 12:33:23Z harti $
@


1.28.12.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.27
log
@Fix builds with a read-only directory and a make upgrade. This is done
by forcing the creation of an object directory for the make regression
tests. Let make handle the tracking of the dependency and installation
of test_shell script.

Submitted by:	ru
@
text
@@


1.26
log
@Make this work under debugging, e.g., "make -dl".
@
text
@a23 3
	@@if [ ! -x ./shell_test ] ; then \
		${INSTALL} -m 555 ${.CURDIR}/shell_test.sh shell_test ; \
	fi
d271 1
a271 1
shell_2:
d298 3
a300 2
clean:
	rm -f shell_test
@


1.25
log
@Make the tests runnable on a read-only src. To do this you must make sure
that you create one of the object directories make knows (see make(1)).
This uses the -C flag, so add a test that checks that make actually accepts
-C. Also fix the test that selects csh via the .SHELL target to work for
tcsh users too.

This commit renames shell_test to shell_test.sh. There is no history
to preserve so go without a repo-copy.

Reviewed by:	ru
@
text
@d21 1
a21 1
SMAKE=	${MAKE} -C ${.CURDIR}
@


1.24
log
@Chmod the shell testscript to be executable if it isn't already. According
to the CVS-Meisters x-mode just happens to work, but is not guaranteed to
do so. Try to be on the safe side.
@
text
@d21 2
d24 6
a29 2
	@@if [ ! -x ${.CURDIR}/shell_test ] ; then chmod +x ${.CURDIR}/shell_test ; fi
	@@echo '1..16'
d31 37
a67 32
		diff -u ${.CURDIR}/regress.variables.out - || ${MAKE} failure
	@@echo "ok 1 - test_variables # Test variables detected no regression, output matches."
	@@${MAKE} double 2>/dev/null || ${MAKE} failure
	@@echo "ok 2 - test_targets # Test targets detected no regression."
	@@${MAKE} sysvmatch || ${MAKE} failure
	@@echo "ok 3 - sysvmatch # Test sysvmatch detected no regression."
	@@! ${MAKE} lhs_expn && true || ${MAKE} failure
	@@echo "ok 4 lhs_expn # Test lhs_expn detected no regression."
	@@${MAKE} notdef || ${MAKE} failure
	@@echo "ok 5 - notdef # Test notdef detected no regression."
	@@${MAKE} modifiers || ${MAKE} failure
	@@echo "ok 6 - modifiers # Test modifiers detected no regression."
	@@${MAKE} funny_targets || ${MAKE} failure
	@@echo "ok 7 funny_targets # Test funny_targets detected no regression."
	@@${MAKE} arith_expr || ${MAKE} failure
	@@echo "ok 8 arith_expr # Test arith_expr detected no regression."
	@@${MAKE} PATH_exists || ${MAKE} failure
	@@echo "ok 9 PATH_exists # Test PATH_exists detected no regression."
	@@${MAKE} double_quotes || ${MAKE} failure
	@@echo "ok 10 double_quotes # Test double_quotes detected no regression."
	@@! ${MAKE} double_quotes2 >/dev/null 2>&1 && true || ${MAKE} failure
	@@echo "ok 11 double_quotes2 # Test double_quotes2 detected no regression."
	@@${MAKE} pass_cmd_vars || ${MAKE} failure
	@@echo "ok 12 pass_cmd_vars # Test pass_cmd_vars detected no regression."
	@@${MAKE} plus_flag || ${MAKE} failure
	@@echo "ok 13 plus_flag # Test plus_flag detected no regression."
	@@! ${MAKE} shell >/dev/null 2>&1 && true || ${MAKE} failure
	@@echo "ok 14 shell # Test shell detected no regression."
	@@${MAKE} shell_1 || ${MAKE} failure
	@@echo "ok 15 shell_1 # Test shell_1 detected no regression."
	@@${MAKE} shell_2 || ${MAKE} failure
	@@echo "ok 16 shell_2 # Test shell_2 detected no regression."
d105 1
a105 1
	@@if ${MAKE} -V .CURDIR:C/.// 2>&1 >/dev/null | \
d152 4
a155 4
	@@${MAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_1
	@@${MAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_2
	@@${MAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_3
	@@${MAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_4
d196 1
a196 1
	@@${MAKE} CMD1=foo1 pass_cmd_vars_3_1
d214 1
a214 1
	@@${MAKE} pass_cmd_vars_4_1
d233 1
a233 1
OUT != ${MAKE} -n plus_flag_1
d257 2
a258 2
	@@${MAKE} shell_1_csh
	@@${MAKE} shell_1_sh
d263 1
a263 1
	@@echo $${shell} | grep -q '^/bin/csh$$'
d275 1
a275 1
	@@${MAKE} -B shell_2B | \
d277 1
a277 1
	@@${MAKE} -j1 shell_2j | \
d282 1
a282 1
.SHELL: name="echo" path="${.CURDIR}/shell_test" quiet="be quiet" echo="be verbose" filter="be verbose" echoFlag="x" errFlag="y" hasErrCtl=y check="check errors" ignore="ignore errors"
d290 1
a290 1
.SHELL: name="echo" path="${.CURDIR}/shell_test" quiet="be quiet" echo="be verbose" filter="be verbose" echoFlag="x" errFlag="y" hasErrCtl=y check="check errors" ignore="ignore errors"
d300 3
@


1.23
log
@Add some regression tests for the .SHELL target. I'm not sure that the
output of shell_2j is actually correct - it just tests what make currently
does. Make should switch on echoing for the second line, shouldn't it?
@
text
@d22 1
@


1.22
log
@Switch over to a different, more flexible test output protocol that's
understood by Perl's Test::Harness module and prove(1) commands.

Update README to describe the new protocol.  The work's broken down into
two main sets of changes.

First, update the existing test programs (shell scripts and C programs)
to produce output in the ok/not ok format, and to, where possible, also
produce a header describing the number of tests that are expected to be
run.

Second, provide the .t files that actually run the tests.  In some cases
these are copies of, or very similar too, scripts that already existed.
I've kept the old scripts around so that it's possible to verify that
behaviour under this new system (in terms of whether or not a test fails)
is identical to the behaviour under the old system.

Add a TODO file.
@
text
@d22 1
a22 1
	@@echo '1..14'
d52 4
d240 45
@


1.21
log
@Add a regression test for the alternate shell specification.
@
text
@d22 1
a22 1
	@@echo "Running test variables"
d25 1
a25 2
	@@echo "PASS: Test variables detected no regression, output matches."
	@@echo "Running test targets"
d27 1
a27 2
	@@echo "PASS: Test targets detected no regression."
	@@echo "Running test sysvmatch"
d29 1
a29 2
	@@echo "PASS: Test sysvmatch detected no regression."
	@@echo "Running test lhs_expn"
d31 1
a31 2
	@@echo "PASS: Test lhs_expn detected no regression."
	@@echo "Running test notdef"
d33 1
a33 2
	@@echo "PASS: Test notdef detected no regression."
	@@echo "Running test modifiers"
d35 1
a35 2
	@@echo "PASS: Test modifiers detected no regression."
	@@echo "Running test funny_targets"
d37 1
a37 2
	@@echo "PASS: Test funny_targets detected no regression."
	@@echo "Running test arith_expr"
d39 1
a39 2
	@@echo "PASS: Test arith_expr detected no regression."
	@@echo "Running test PATH_exists"
d41 1
a41 2
	@@echo "PASS: Test PATH_exists detected no regression."
	@@echo "Running test double_quotes"
d43 1
a43 2
	@@echo "PASS: Test double_quotes detected no regression."
	@@echo "Running test double_quotes2"
d45 1
a45 2
	@@echo "PASS: Test double_quotes2 detected no regression."
	@@echo "Running test pass_cmd_vars"
d47 1
a47 2
	@@echo "PASS: Test pass_cmd_vars detected no regression."
	@@echo "Running test plus_flag"
d49 1
a49 2
	@@echo "PASS: Test plus_flag detected no regression."
	@@echo "Running test shell"
d51 1
a51 1
	@@echo "PASS: Test shell detected no regression."
d237 1
a237 1
	@@echo "FAIL: Test failed: regression detected.  See above."
@


1.20
log
@Now that make more correctly handles variable assignments
in .MAKEFLAGS targets enable the regression test for this.
@
text
@d62 3
d240 7
@


1.19
log
@Back out something I'm working on that crept in with the last commit.

Spotted by: ru
@
text
@d208 1
a208 3
	@@:
# The following does not work yet (see standards/57295)
#	@@${MAKE} pass_cmd_vars_4_1
@


1.18
log
@Remove extra spaces. Remove double quotes around error messages -
they are not needed and will actually be printed.

Submitted by:	ru
@
text
@d208 3
a210 1
	@@${MAKE} pass_cmd_vars_4_1
@


1.17
log
@Add another test that checks for a working '+' command flag.
@
text
@d56 1
a56 1
	@@echo "Running test pass_cmd_vars "
d59 1
a59 1
	@@echo "Running test plus_flag "
d158 1
a158 1
.error "variables not passed through MAKEFLAGS"
d163 1
a163 1
.error "variable assignment not found in $${MAKEFLAGS}"
d168 1
a168 1
.error "variable assignment found in $${MFLAGS}"
d178 1
a178 1
.error "MAKEFLAGS-passed variables overridden"
d195 1
a195 1
.error "MAKEFLAGS-passed variables not overridden on command line"
d208 1
a208 3
	@@:
# The following does not yet work (see standards/57295)
#	${MAKE} pass_cmd_vars_4_1
d211 1
a211 1
.error "MAKEFLAGS-passed variables not overridden via .MAKEFLAGS target"
d217 1
a217 1
.error "MAKEFLAGS-passed variables not overridden via .MAKEFLAGS target (2)"
d229 1
a229 1
.error "make doesn't handle + flag"
@


1.16
log
@Add a regression test for the passing of command line
variable assignments via the MAKEFLAGS environment variable.
@
text
@d59 3
d223 16
@


1.15
log
@Add a test for what was broken in rev. 1.28 and fixed in rev. 1.29
of make/str.c.
@
text
@d56 3
d136 84
@


1.14
log
@Add a test for what was fixed in revs. 1.28 and 1.29 of make/str.c.
@
text
@d53 3
d128 5
@


1.13
log
@Fix a bug that prevented exists() from finding "foo/", "foo/."
and "foo/.." when ".PATH: foo" was also given.

PR:		bin/34062
@
text
@d50 3
d116 8
@


1.12
log
@Fixed broken arithmetic expression parser.

Reminded by:	bde
In memory of:	alane
@
text
@d47 3
d105 8
@


1.11
log
@The regression-tests for 'make' *expect* to trigger make's warning:
       warning: duplicate script for target "double" ignored
The regression-tests do try to hide that message, but the message does
still appear when using -j (eg: 'make -j5 buildworld').  This changes the
regression-test so the expected warning message will not be seen even
when -j is specified.

Reviewed by:	jmallett  ru
@
text
@d44 3
d94 9
@


1.10
log
@Add a test for what was fixed in revisions 1.39 and 1.50 of
make/parse.c (allow embedded `:' and `!' in target names).

Approved by:	re
@
text
@d27 1
a27 1
	@@${MAKE} double || ${MAKE} failure
@


1.9
log
@Moved make(1) regression tests from src/Makefile to where they
belong (src/tools/regression/usr.bin/make), and use the latter
to test if make(1) is adequate for building the world.

Approved by:	re
@
text
@d41 3
d85 6
@


1.8
log
@Hide the test in <target> under '.if make(<target>)' so as to not get any
errors/warnings related to crud in said test block.
@
text
@d4 1
a4 1
# This *must* case make(1) to detect a recursive variable, and fail as such.
d35 6
d65 18
@


1.7
log
@As of revision 1.38 of make/parse.c, our make(1) will warn too.  Note that
this isn't just for the sake of testing behaviour, and that things really
do break if this regression occurs.
@
text
@d36 1
d45 1
d47 1
d52 1
@


1.6
log
@Grrr, make the test for embedded variables in the left-hand-side actually do
the right thing in every case.  Yuck.
@
text
@d36 3
a38 2
# Doubly-defined targets.  NetBSD make(1) will warn, ours will silently use the
# ``right'' one.
@


1.5
log
@Add a test for what was fixed in revision 1.27 and 1.28 of make(1)'s var.c,
expansion of embedded variables in the left-hand-side of an assignment
expression, using the simplest case - hiding recursion using nil-expanded
variables.
@
text
@d33 1
a33 1
	@@${MAKE} lhs_expn || ${MAKE} failure
d53 1
a53 1
	@@false
@


1.4
log
@Add a regression test for bin/5297, regarding sysv substitution with a nil
left-hand-side.
@
text
@d3 8
d32 3
d48 6
@


1.3
log
@Prefix tests with PASS and FAIL, to make grepping easier, and note this in
the README.

This affects only the base-system regression tests, of course.
@
text
@d11 1
d21 3
d32 5
@


1.2
log
@Check to see if make(1)'s handling of doubly-defined targets is busted or
not.  A lot relies on this.
@
text
@d16 1
a16 1
	@@echo "Test variables detected no regression, output matches."
d19 1
a19 1
	@@echo "Test targets detected no regression."
d30 1
a30 1
	@@echo "Test failed: regression detected.  See above."
@


1.1
log
@Add a test of variable evaluation and substitution for make(1), as a start
of tests for it.
@
text
@d17 11
@

