Module Name: src
Committed By: rillig
Date: Sat Oct 31 22:55:35 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: directive-include.exp directive-include.mk
Log Message:
make(1): add test for off-by-one bug in ParseTrackInput
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/directive-include.exp \
src/usr.bin/make/unit-tests/directive-include.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/directive-include.exp
diff -u src/usr.bin/make/unit-tests/directive-include.exp:1.1 src/usr.bin/make/unit-tests/directive-include.exp:1.2
--- src/usr.bin/make/unit-tests/directive-include.exp:1.1 Sun Sep 13 09:20:23 2020
+++ src/usr.bin/make/unit-tests/directive-include.exp Sat Oct 31 22:55:35 2020
@@ -1 +1,7 @@
+CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null"
+lhs = "directive-include.mk null", rhs = "directive-include.mk null", op = !=
+CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null null"
+lhs = "directive-include.mk null null", rhs = "directive-include.mk null null", op = !=
+CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null null"
+lhs = "directive-include.mk null null", rhs = "directive-include.mk null null", op = !=
exit status 0
Index: src/usr.bin/make/unit-tests/directive-include.mk
diff -u src/usr.bin/make/unit-tests/directive-include.mk:1.1 src/usr.bin/make/unit-tests/directive-include.mk:1.2
--- src/usr.bin/make/unit-tests/directive-include.mk:1.1 Sun Sep 13 09:20:23 2020
+++ src/usr.bin/make/unit-tests/directive-include.mk Sat Oct 31 22:55:35 2020
@@ -1,8 +1,33 @@
-# $NetBSD: directive-include.mk,v 1.1 2020/09/13 09:20:23 rillig Exp $
+# $NetBSD: directive-include.mk,v 1.2 2020/10/31 22:55:35 rillig Exp $
#
# Tests for the .include directive, which includes another file.
# TODO: Implementation
+.MAKEFLAGS: -dc
+
+# All included files are recorded in the variable .MAKE.MAKEFILES.
+# In this test, only the basenames of the files are compared since
+# the directories can differ.
+.include "/dev/null"
+.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null"
+. error
+.endif
+
+# Each file is recorded only once in the variable .MAKE.MAKEFILES.
+# XXX: As of 2020-10-31, the very last file can be repeated, due to an
+# off-by-one bug in ParseTrackInput.
+.include "/dev/null"
+.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null null"
+. error
+.endif
+
+# Since the file /dev/null is not only recorded at the very end of the
+# variable .MAKE.MAKEFILES, it is not added a third time.
+.include "/dev/null"
+.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null null"
+. error
+.endif
+
all:
@:;