summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2012-03-03 18:45:08 +0000
committerPaul Smith <psmith@gnu.org>2012-03-03 18:45:08 +0000
commit88f1bc8b55b9f5abf35fdf974310c1063fa41068 (patch)
treebe70080dda3724b65809d43052f21550a59cb29a /tests/scripts
parent6405534814f04899890a2d932db9a4985fd772fe (diff)
downloadgunmake-88f1bc8b55b9f5abf35fdf974310c1063fa41068.tar.gz
Modify backslash/newline handling for POSIX.
We fixed Savannah 16670 but that broke previously-working makefiles that relied on the GNU make behavior. The POSIX behavior doesn't seem to me to be better, and can be obtained using GNU make as well, so put it back as the default behavior and require .POSIX to get the POSIX behavior. Add a new section to the manual discussing backslash/newline handling. Update the test suite.
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/misc/bs-nl56
1 files changed, 41 insertions, 15 deletions
diff --git a/tests/scripts/misc/bs-nl b/tests/scripts/misc/bs-nl
index 979abb5..e27a3f7 100644
--- a/tests/scripts/misc/bs-nl
+++ b/tests/scripts/misc/bs-nl
@@ -50,27 +50,53 @@ run_make_test("squote:;\@echo 'squ\\\n\t\t ote'\n",
# Backslash-newlines in variable values
# Simple
-run_make_test("
-var = he\\\nllo
-var:;\@echo '|\$(var)|'",
+run_make_test(q!
+var = he\
+llo
+var:;@echo '|$(var)|'!,
'', "|he llo|");
-# Preserve preceding space
-run_make_test("
-var = he \\\nllo
-var:;\@echo '|\$(var)|'",
- '', "|he llo|");
+# Condense trailing space
+run_make_test(q!
+var = he \
+llo
+var:;@echo '|$(var)|'!,
+ '', "|he llo|");
# Remove leading space
-run_make_test("
-var = he\\\n llo
-var:;\@echo '|\$(var)|'",
+run_make_test(q!
+var = he\
+ llo
+var:;@echo '|$(var)|'!,
+ '', "|he llo|");
+
+# Multiple bs/nl condensed
+run_make_test(q!
+var = he\
+\
+\
+ llo
+var:;@echo '|$(var)|'!,
'', "|he llo|");
-# One space per bs-nl
-run_make_test("
-var = he\\\n\\\n\\\n llo
-var:;\@echo '|\$(var)|'",
+# POSIX: Preserve trailing space
+run_make_test(q!
+.POSIX:
+x = y
+var = he \
+llo
+var:;@echo '|$(var)|'!,
+ '', "|he llo|");
+
+# POSIX: One space per bs-nl
+run_make_test(q!
+.POSIX:
+x = y
+var = he\
+\
+\
+ llo
+var:;@echo '|$(var)|'!,
'', "|he llo|");
1;