Module Name: src Committed By: rillig Date: Wed Jun 16 09:39:48 UTC 2021
Modified Files: src/distrib/sets/lists/tests: mi src/usr.bin/make/unit-tests: Makefile Added Files: src/usr.bin/make/unit-tests: jobs-empty-commands-error.exp jobs-empty-commands-error.mk Log Message: tests/make: demonstrate wrong error handling in jobs mode To generate a diff of this commit: cvs rdiff -u -r1.1056 -r1.1057 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.278 -r1.279 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r0 -r1.1 \ src/usr.bin/make/unit-tests/jobs-empty-commands-error.exp \ src/usr.bin/make/unit-tests/jobs-empty-commands-error.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.1056 src/distrib/sets/lists/tests/mi:1.1057 --- src/distrib/sets/lists/tests/mi:1.1056 Sun Jun 6 04:59:36 2021 +++ src/distrib/sets/lists/tests/mi Wed Jun 16 09:39:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1056 2021/06/06 04:59:36 blymn Exp $ +# $NetBSD: mi,v 1.1057 2021/06/16 09:39:48 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -5496,6 +5496,8 @@ ./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/job-output-null.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/job-output-null.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands-error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands-error.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands.mk tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/make/unit-tests/jobs-error-indirect.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.278 src/usr.bin/make/unit-tests/Makefile:1.279 --- src/usr.bin/make/unit-tests/Makefile:1.278 Tue May 18 17:05:45 2021 +++ src/usr.bin/make/unit-tests/Makefile Wed Jun 16 09:39:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.278 2021/05/18 17:05:45 sjg Exp $ +# $NetBSD: Makefile,v 1.279 2021/06/16 09:39:48 rillig Exp $ # # Unit tests for make(1) # @@ -206,6 +206,7 @@ TESTS+= job-flags TESTS+= job-output-long-lines TESTS+= job-output-null TESTS+= jobs-empty-commands +TESTS+= jobs-empty-commands-error TESTS+= jobs-error-indirect TESTS+= jobs-error-nested TESTS+= jobs-error-nested-make Added files: Index: src/usr.bin/make/unit-tests/jobs-empty-commands-error.exp diff -u /dev/null src/usr.bin/make/unit-tests/jobs-empty-commands-error.exp:1.1 --- /dev/null Wed Jun 16 09:39:48 2021 +++ src/usr.bin/make/unit-tests/jobs-empty-commands-error.exp Wed Jun 16 09:39:48 2021 @@ -0,0 +1,4 @@ +: 'Making existing-target out of nothing.' +make: don't know how to make nonexistent-target (continuing) +`nonexistent-target' was not built (being made, type OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONE_ALLSRC|DONECYCLE)! +exit status 1 Index: src/usr.bin/make/unit-tests/jobs-empty-commands-error.mk diff -u /dev/null src/usr.bin/make/unit-tests/jobs-empty-commands-error.mk:1.1 --- /dev/null Wed Jun 16 09:39:48 2021 +++ src/usr.bin/make/unit-tests/jobs-empty-commands-error.mk Wed Jun 16 09:39:48 2021 @@ -0,0 +1,19 @@ +# $NetBSD: jobs-empty-commands-error.mk,v 1.1 2021/06/16 09:39:48 rillig Exp $ +# +# In jobs mode, the shell commands for creating a target are written to a +# temporary file first, which is then run by the shell. In chains of +# dependencies, these files would end up empty. Since job.c 1.399 from +# 2021-01-29, these empty files are no longer created. +# +# After 2021-01-29, before job.c 1.435 2021-06-16, targets that could not be +# made led to longer error messages than necessary. + +.MAKEFLAGS: -j1 + +all: existing-target + +existing-target: + : 'Making $@ out of nothing.' + +all: nonexistent-target + : 'Not reached'