Mon Nov 2 20:19:33 2020 UTC ()
make(1): handle errors when sync-mi fails because of a syntax error


(rillig)
diff -r1.181 -r1.182 src/usr.bin/make/unit-tests/Makefile

cvs diff -r1.181 -r1.182 src/usr.bin/make/unit-tests/Makefile (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/Makefile 2020/11/01 19:02:22 1.181
+++ src/usr.bin/make/unit-tests/Makefile 2020/11/02 20:19:33 1.182
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.181 2020/11/01 19:02:22 rillig Exp $ 1# $NetBSD: Makefile,v 1.182 2020/11/02 20:19:33 rillig Exp $
2# 2#
3# Unit tests for make(1) 3# Unit tests for make(1)
4# 4#
5# The main targets are: 5# The main targets are:
6# 6#
7# all: 7# all:
8# run all the tests 8# run all the tests
9# test: 9# test:
10# run 'all', and compare to expected results 10# run 'all', and compare to expected results
11# accept: 11# accept:
12# move generated output to expected results 12# move generated output to expected results
13# 13#
14# Settable variables 14# Settable variables
@@ -534,27 +534,30 @@ accept: @@ -534,27 +534,30 @@ accept:
534 || { echo "Replacing $${test}.exp" ; \ 534 || { echo "Replacing $${test}.exp" ; \
535 cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ 535 cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \
536 done 536 done
537 537
538# Note: only works for adding tests. 538# Note: only works for adding tests.
539# To remove a test, the $$mi file must be edited manually. 539# To remove a test, the $$mi file must be edited manually.
540sync-mi: 540sync-mi:
541 @set -eu; \ 541 @set -eu; \
542 cd "${MAKEFILE:tA:H}/../../.."; \ 542 cd "${MAKEFILE:tA:H}/../../.."; \
543 mi="distrib/sets/lists/tests/mi"; \ 543 mi="distrib/sets/lists/tests/mi"; \
544 cvs update "$$mi"; \ 544 cvs update "$$mi"; \
545 testsdir="usr.bin/make/unit-tests"; \ 545 testsdir="usr.bin/make/unit-tests"; \
546 fmt="./usr/tests/$$testsdir/%s\ttests-usr.bin-tests\tcompattestfile,atf\\n"; \ 546 fmt="./usr/tests/$$testsdir/%s\ttests-usr.bin-tests\tcompattestfile,atf\\n"; \
547 (cd "$$testsdir" && ls *.exp *.mk) | xargs printf "$$fmt" >> "$$mi"; \ 547 cat "$$mi" > "$$mi.tmp"; \
548 distrib/sets/fmt-list "$$mi"; \ 548 (cd "$$testsdir" && ls *.exp *.mk) | xargs printf "$$fmt" >> "$$mi.tmp"; \
 549 distrib/sets/fmt-list "$$mi.tmp"; \
 550 echo $$?; \
 551 mv "$$mi.tmp" "$$mi"; \
549 cvs diff "$$mi" || true 552 cvs diff "$$mi" || true
550 553
551.if exists(${TEST_MAKE}) 554.if exists(${TEST_MAKE})
552${TESTS:=.rawout}: ${TEST_MAKE} 555${TESTS:=.rawout}: ${TEST_MAKE}
553# in meta mode, we *know* if a target script is impacted 556# in meta mode, we *know* if a target script is impacted
554# by a makefile change. 557# by a makefile change.
555.if ${.MAKE.MODE:Unormal:Mmeta} == "" 558.if ${.MAKE.MODE:Unormal:Mmeta} == ""
556${TESTS:=.rawout}: ${.PARSEDIR}/Makefile 559${TESTS:=.rawout}: ${.PARSEDIR}/Makefile
557.endif 560.endif
558.endif 561.endif
559 562
560.-include <bsd.obj.mk> 563.-include <bsd.obj.mk>