diff options
author | Paul Smith <psmith@gnu.org> | 2012-03-03 18:45:08 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2012-03-03 18:45:08 +0000 |
commit | 88f1bc8b55b9f5abf35fdf974310c1063fa41068 (patch) | |
tree | be70080dda3724b65809d43052f21550a59cb29a /tests/scripts/misc | |
parent | 6405534814f04899890a2d932db9a4985fd772fe (diff) | |
download | gunmake-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/misc')
-rw-r--r-- | tests/scripts/misc/bs-nl | 56 |
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; |