Module Name: src Committed By: rillig Date: Sun Dec 27 05:11:40 UTC 2020
Modified Files: src/distrib/sets/lists/tests: mi src/usr.bin/make/unit-tests: Makefile cmd-errors.mk Added Files: src/usr.bin/make/unit-tests: cmd-errors-jobs.exp cmd-errors-jobs.mk Log Message: make(1): add test for expansion errors in jobs mode Since compat mode and jobs mode are implemented separately and vary in lots of small details, each of them needs to be tested on its own. To generate a diff of this commit: cvs rdiff -u -r1.996 -r1.997 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.256 -r1.257 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/cmd-errors-jobs.exp \ src/usr.bin/make/unit-tests/cmd-errors-jobs.mk cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/cmd-errors.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.996 src/distrib/sets/lists/tests/mi:1.997 --- src/distrib/sets/lists/tests/mi:1.996 Sat Dec 19 16:00:17 2020 +++ src/distrib/sets/lists/tests/mi Sun Dec 27 05:11:40 2020 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.996 2020/12/19 16:00:17 rillig Exp $ +# $NetBSD: mi,v 1.997 2020/12/27 05:11:40 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -4818,6 +4818,8 @@ ./usr/tests/usr.bin/make/unit-tests/archive-suffix.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/archive.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/archive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors-jobs.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/cmd-errors-lint.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/cmd-errors-lint.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/cmd-errors.exp tests-usr.bin-tests compattestfile,atf Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.256 src/usr.bin/make/unit-tests/Makefile:1.257 --- src/usr.bin/make/unit-tests/Makefile:1.256 Mon Dec 21 20:47:29 2020 +++ src/usr.bin/make/unit-tests/Makefile Sun Dec 27 05:11:40 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.256 2020/12/21 20:47:29 rillig Exp $ +# $NetBSD: Makefile,v 1.257 2020/12/27 05:11:40 rillig Exp $ # # Unit tests for make(1) # @@ -42,6 +42,7 @@ TESTS+= archive TESTS+= archive-suffix TESTS+= cmd-errors +TESTS+= cmd-errors-jobs TESTS+= cmd-errors-lint TESTS+= cmd-interrupt TESTS+= cmdline Index: src/usr.bin/make/unit-tests/cmd-errors.mk diff -u src/usr.bin/make/unit-tests/cmd-errors.mk:1.3 src/usr.bin/make/unit-tests/cmd-errors.mk:1.4 --- src/usr.bin/make/unit-tests/cmd-errors.mk:1.3 Mon Nov 9 23:36:34 2020 +++ src/usr.bin/make/unit-tests/cmd-errors.mk Sun Dec 27 05:11:40 2020 @@ -1,7 +1,7 @@ -# $NetBSD: cmd-errors.mk,v 1.3 2020/11/09 23:36:34 rillig Exp $ +# $NetBSD: cmd-errors.mk,v 1.4 2020/12/27 05:11:40 rillig Exp $ # # Demonstrate how errors in variable expansions affect whether the commands -# are actually executed. +# are actually executed in compat mode. all: undefined unclosed-variable unclosed-modifier unknown-modifier end Added files: Index: src/usr.bin/make/unit-tests/cmd-errors-jobs.exp diff -u /dev/null src/usr.bin/make/unit-tests/cmd-errors-jobs.exp:1.1 --- /dev/null Sun Dec 27 05:11:41 2020 +++ src/usr.bin/make/unit-tests/cmd-errors-jobs.exp Sun Dec 27 05:11:40 2020 @@ -0,0 +1,9 @@ +: undefined eol +make: Unclosed variable "UNCLOSED" +: unclosed-variable +make: Unclosed variable expression (expecting '}') for "UNCLOSED" +: unclosed-modifier +make: Unknown modifier 'Z' +: unknown-modifier eol +: end eol +exit status 0 Index: src/usr.bin/make/unit-tests/cmd-errors-jobs.mk diff -u /dev/null src/usr.bin/make/unit-tests/cmd-errors-jobs.mk:1.1 --- /dev/null Sun Dec 27 05:11:41 2020 +++ src/usr.bin/make/unit-tests/cmd-errors-jobs.mk Sun Dec 27 05:11:40 2020 @@ -0,0 +1,32 @@ +# $NetBSD: cmd-errors-jobs.mk,v 1.1 2020/12/27 05:11:40 rillig Exp $ +# +# Demonstrate how errors in variable expansions affect whether the commands +# are actually executed in jobs mode. + +.MAKEFLAGS: -j1 + +all: undefined unclosed-variable unclosed-modifier unknown-modifier end + +# Undefined variables are not an error. They expand to empty strings. +undefined: + : $@ ${UNDEFINED} eol + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-variable: + : $@ ${UNCLOSED + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-modifier: + : $@ ${UNCLOSED: + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unknown-modifier: + : $@ ${UNKNOWN:Z} eol + +end: + : $@ eol + +# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.