]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS
authorPaul Smith <psmith@gnu.org>
Sun, 25 Aug 2019 04:20:38 +0000 (00:20 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 26 Aug 2019 11:54:09 +0000 (07:54 -0400)
tests/scripts/misc/general3

index a4b1128658830ba44c4301cfb5010ff0e3e53748..f8cded0d307eb4b2f1c79aeb27da4266888430e1 100644 (file)
@@ -90,25 +90,25 @@ foo bar');
 # Test the fastpath / single quotes
 # Single quotes don't behave the same in Windows
 if ($port_type ne 'W32') {
-    run_make_test("
+    run_make_test(q!
 all:
-       \@echo 'foo\\
+       @echo 'foo\
 bar'
-       \@echo 'foo\\
+       @echo 'foo\
        bar'
-       \@echo 'foo\\
+       @echo 'foo\
     bar'
-       \@echo 'foo\\
+       @echo 'foo\
            bar'
-       \@echo 'foo \\
+       @echo 'foo \
 bar'
-       \@echo 'foo \\
+       @echo 'foo \
        bar'
-       \@echo 'foo \\
+       @echo 'foo \
     bar'
-       \@echo 'foo \\
+       @echo 'foo \
            bar'
-",
+!,
               '', 'foo\
 bar
 foo\
@@ -232,25 +232,25 @@ foo bar
 hi');
 
 # Test the slow path / single quotes
-run_make_test("
+run_make_test(q!
 all:
-       \@echo hi; echo 'foo\\
+       @echo hi; echo 'foo\
 bar'
-       \@echo hi; echo 'foo\\
+       @echo hi; echo 'foo\
        bar'
-       \@echo hi; echo 'foo\\
+       @echo hi; echo 'foo\
     bar'
-       \@echo hi; echo 'foo\\
+       @echo hi; echo 'foo\
            bar'
-       \@echo hi; echo 'foo \\
+       @echo hi; echo 'foo \
 bar'
-       \@echo hi; echo 'foo \\
+       @echo hi; echo 'foo \
        bar'
-       \@echo hi; echo 'foo \\
+       @echo hi; echo 'foo \
     bar'
-       \@echo hi; echo 'foo \\
+       @echo hi; echo 'foo \
            bar'
-",
+!,
               '', 'hi
 foo\
 bar
@@ -315,4 +315,33 @@ foo     bar');
 
 run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#;1: x] Error 1 (ignored)\n");
 
+# Slow path with odd setups
+
+if ($port_type ne 'W32') {
+    run_make_test(q!
+    slow: SHELL := echo
+    slow: .SHELLFLAGS := hoho
+    slow:; @foo bar
+    !,
+                  '', "hoho foo bar\n");
+
+    run_make_test(q!
+    slow: SHELL := echo hi
+    slow: .SHELLFLAGS := ho ho
+    slow:; @foo bar
+    !,
+                  '', "hi ho ho foo bar\n");
+
+    run_make_test(q!
+    slow: SHELL := echo hi
+    slow: .SHELLFLAGS := 'ho;ho'
+    slow:; @foo bar
+    !,
+                  '', "hi ho;ho foo bar\n");
+}
+
 1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End: