Module Name: src Committed By: sjg Date: Tue May 18 17:05:45 UTC 2021
Modified Files: src/usr.bin/make/unit-tests: Makefile opt-chdir.mk Log Message: Do not trust that /nonexistent does not exist Use /nonexistent.${.MAKE.PID} to avoid failure when /nonexistent actually exists. To generate a diff of this commit: cvs rdiff -u -r1.277 -r1.278 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt-chdir.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.277 src/usr.bin/make/unit-tests/Makefile:1.278 --- src/usr.bin/make/unit-tests/Makefile:1.277 Tue Apr 27 16:20:06 2021 +++ src/usr.bin/make/unit-tests/Makefile Tue May 18 17:05:45 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.277 2021/04/27 16:20:06 rillig Exp $ +# $NetBSD: Makefile,v 1.278 2021/05/18 17:05:45 sjg Exp $ # # Unit tests for make(1) # @@ -487,6 +487,7 @@ SED_CMDS.job-output-long-lines= \ ${:D marker should always be at the beginning of the line. } \ -e '/^aa*--- job-b ---$$/d' \ -e '/^bb*--- job-a ---$$/d' +SED_CMDS.opt-chdir= -e 's,\(nonexistent\).[1-9][0-9]*,\1,' SED_CMDS.opt-debug-graph1= ${STD_SED_CMDS.dg1} SED_CMDS.opt-debug-graph2= ${STD_SED_CMDS.dg2} SED_CMDS.opt-debug-graph3= ${STD_SED_CMDS.dg3} Index: src/usr.bin/make/unit-tests/opt-chdir.mk diff -u src/usr.bin/make/unit-tests/opt-chdir.mk:1.5 src/usr.bin/make/unit-tests/opt-chdir.mk:1.6 --- src/usr.bin/make/unit-tests/opt-chdir.mk:1.5 Sun Nov 15 05:43:56 2020 +++ src/usr.bin/make/unit-tests/opt-chdir.mk Tue May 18 17:05:45 2021 @@ -1,4 +1,4 @@ -# $NetBSD: opt-chdir.mk,v 1.5 2020/11/15 05:43:56 sjg Exp $ +# $NetBSD: opt-chdir.mk,v 1.6 2021/05/18 17:05:45 sjg Exp $ # # Tests for the -C command line option, which changes the directory at the # beginning. @@ -23,5 +23,7 @@ chdir-root: .PHONY .IGNORE @MAKE_OBJDIR_CHECK_WRITABLE=no ${MAKE} -C / -V 'cwd: $${.CURDIR}' # Trying to change to a nonexistent directory exits immediately. +# Note: just because the whole point of /nonexistent is that it should +# not exist - doesn't mean it doesn't. chdir-nonexistent: .PHONY .IGNORE - @${MAKE} -C /nonexistent + @${MAKE} -C /nonexistent.${.MAKE.PID}