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
This commit is contained in:
Ruslan Ermilov 2002-11-28 13:08:09 +00:00
parent 43b92fef62
commit 113cf9e649
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107374
3 changed files with 54 additions and 30 deletions

View File

@ -156,39 +156,15 @@ kernel: buildkernel installkernel
# #
# Perform a few tests to determine if the installed tools are adequate # Perform a few tests to determine if the installed tools are adequate
# for building the world. These are for older systems (prior to 2.2.5). # for building the world.
#
# From 2.2.5 onwards, the installed tools will pass these upgrade tests,
# so the normal make world is capable of doing what is required to update
# the system to current.
# #
upgrade_checks: upgrade_checks:
@cd ${.CURDIR}; \ @(cd ${.CURDIR}/tools/regression/usr.bin/make && make 2>/dev/null) || \
if ! make -m ${.CURDIR}/share/mk -Dnotdef test >/dev/null 2>&1; then \ (cd ${.CURDIR} && make make)
make make; \
fi
@cd ${.CURDIR}; \
if make -V .CURDIR:C/.// 2>&1 >/dev/null | \
grep -q "Unknown modifier 'C'"; then \
make make; \
fi
#
# A simple test target used as part of the test to see if make supports
# the -m argument. Also test that make will only evaluate a conditional
# as far as is necessary to determine its value.
#
test:
.if defined(notdef)
.undef notdef
.if defined(notdef) && ${notdef:U}
.endif
.endif
# #
# Upgrade the installed make to the current version using the installed # Upgrade the installed make to the current version using the installed
# headers, libraries and build tools. This is required on installed versions # headers, libraries and tools.
# prior to 2.2.5 in which the installed make doesn't support the -m argument.
# #
make: make:
@echo @echo

View File

@ -1,7 +1,7 @@
# $FreeBSD$ # $FreeBSD$
# Test for broken LHS expansion. # Test for broken LHS expansion.
# This *must* case make(1) to detect a recursive variable, and fail as such. # This *must* cause make(1) to detect a recursive variable, and fail as such.
.if make(lhs_expn) .if make(lhs_expn)
FOO= ${BAR} FOO= ${BAR}
BAR${NIL}= ${FOO} BAR${NIL}= ${FOO}
@ -32,6 +32,12 @@ all:
@echo "Running test lhs_expn" @echo "Running test lhs_expn"
@! ${MAKE} lhs_expn && true || ${MAKE} failure @! ${MAKE} lhs_expn && true || ${MAKE} failure
@echo "PASS: Test lhs_expn detected no regression." @echo "PASS: Test lhs_expn detected no regression."
@echo "Running test notdef"
@${MAKE} notdef || ${MAKE} failure
@echo "PASS: Test notdef detected no regression."
@echo "Running test modifiers"
@${MAKE} modifiers || ${MAKE} failure
@echo "PASS: Test modifiers detected no regression."
.if make(double) .if make(double)
# Doubly-defined targets. make(1) will warn, but use the "right" one. If it # Doubly-defined targets. make(1) will warn, but use the "right" one. If it
@ -57,6 +63,24 @@ sysvmatch:
lhs_expn: lhs_expn:
@true @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 ${MAKE} -V .CURDIR:C/.// 2>&1 >/dev/null | \
grep -q "Unknown modifier 'C'"; then \
false; \
fi
.endif
failure: failure:
@echo "FAIL: Test failed: regression detected. See above." @echo "FAIL: Test failed: regression detected. See above."
@false @false

View File

@ -1,7 +1,7 @@
# $FreeBSD$ # $FreeBSD$
# Test for broken LHS expansion. # Test for broken LHS expansion.
# This *must* case make(1) to detect a recursive variable, and fail as such. # This *must* cause make(1) to detect a recursive variable, and fail as such.
.if make(lhs_expn) .if make(lhs_expn)
FOO= ${BAR} FOO= ${BAR}
BAR${NIL}= ${FOO} BAR${NIL}= ${FOO}
@ -32,6 +32,12 @@ all:
@echo "Running test lhs_expn" @echo "Running test lhs_expn"
@! ${MAKE} lhs_expn && true || ${MAKE} failure @! ${MAKE} lhs_expn && true || ${MAKE} failure
@echo "PASS: Test lhs_expn detected no regression." @echo "PASS: Test lhs_expn detected no regression."
@echo "Running test notdef"
@${MAKE} notdef || ${MAKE} failure
@echo "PASS: Test notdef detected no regression."
@echo "Running test modifiers"
@${MAKE} modifiers || ${MAKE} failure
@echo "PASS: Test modifiers detected no regression."
.if make(double) .if make(double)
# Doubly-defined targets. make(1) will warn, but use the "right" one. If it # Doubly-defined targets. make(1) will warn, but use the "right" one. If it
@ -57,6 +63,24 @@ sysvmatch:
lhs_expn: lhs_expn:
@true @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 ${MAKE} -V .CURDIR:C/.// 2>&1 >/dev/null | \
grep -q "Unknown modifier 'C'"; then \
false; \
fi
.endif
failure: failure:
@echo "FAIL: Test failed: regression detected. See above." @echo "FAIL: Test failed: regression detected. See above."
@false @false