Module Name: src
Committed By: rillig
Date: Sun Dec 6 19:00:48 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: opt-file.exp opt-file.mk
Log Message:
make(1): test parsing a makefile that ends in a backslash
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-file.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-file.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/opt-file.exp
diff -u src/usr.bin/make/unit-tests/opt-file.exp:1.1 src/usr.bin/make/unit-tests/opt-file.exp:1.2
--- src/usr.bin/make/unit-tests/opt-file.exp:1.1 Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/opt-file.exp Sun Dec 6 19:00:48 2020
@@ -1 +1,2 @@
+value
exit status 0
Index: src/usr.bin/make/unit-tests/opt-file.mk
diff -u src/usr.bin/make/unit-tests/opt-file.mk:1.2 src/usr.bin/make/unit-tests/opt-file.mk:1.3
--- src/usr.bin/make/unit-tests/opt-file.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/opt-file.mk Sun Dec 6 19:00:48 2020
@@ -1,8 +1,17 @@
-# $NetBSD: opt-file.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: opt-file.mk,v 1.3 2020/12/06 19:00:48 rillig Exp $
#
# Tests for the -f command line option.
# TODO: Implementation
+all: .PHONY file-ending-in-backslash
+
+# Passing '-' as the filename reads from stdin. This is unusual but possible.
+#
+# In the unlikely case where a file ends in a backslash instead of a newline,
+# that backslash is trimmed. See ParseGetLine.
+file-ending-in-backslash: .PHONY
+ @printf '%s' 'VAR=value\' | ${MAKE} -r -f - -v VAR
+
all:
@:;