diff --git a/distrib/sets/lists/tests/mi b/distrib/sets/lists/tests/mi index 6f16f3123355..9dd32a160cae 100644 --- a/distrib/sets/lists/tests/mi +++ b/distrib/sets/lists/tests/mi @@ -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 diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index 4ab913317b92..b5a3da91aa06 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -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 diff --git a/usr.bin/make/unit-tests/cmd-errors-jobs.exp b/usr.bin/make/unit-tests/cmd-errors-jobs.exp new file mode 100644 index 000000000000..6d9c6bb7f890 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors-jobs.exp @@ -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 diff --git a/usr.bin/make/unit-tests/cmd-errors-jobs.mk b/usr.bin/make/unit-tests/cmd-errors-jobs.mk new file mode 100644 index 000000000000..8462a2e3497e --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors-jobs.mk @@ -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. diff --git a/usr.bin/make/unit-tests/cmd-errors.mk b/usr.bin/make/unit-tests/cmd-errors.mk index 5ad4be311873..356fe1a3e4a2 100644 --- a/usr.bin/make/unit-tests/cmd-errors.mk +++ b/usr.bin/make/unit-tests/cmd-errors.mk @@ -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