]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Update regression tests for Windows.
authorPaul Smith <psmith@nuodb.com>
Sun, 1 Jul 2018 20:13:13 +0000 (16:13 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 2 Jul 2018 11:54:07 +0000 (07:54 -0400)
* tests/scripts/features/jobserver: Windows doesn't use pipes
* tests/scripts/functions/shell: Don't test kill -2 on Windows
* tests/scripts/misc/bs-nl: Windows doesn't handle single quotes
* tests/scripts/misc/general3: Ditto.

tests/scripts/features/jobserver
tests/scripts/functions/shell
tests/scripts/misc/bs-nl
tests/scripts/misc/general3
tests/scripts/variables/SHELL

index f9781bee46f86a5ff0ac1cf1c6fab27af833ed52..73d10d9f1090d76483c36a23fa0de322e6a83e35 100644 (file)
@@ -80,25 +80,27 @@ inc.mk:
 
 unlink('inc.mk');
 
-# Test recursion when make doesn't think it exists.
+# Test recursion which is hidden from make.
 # See Savannah bug #39934
 # Or Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=885474
-
-open(MAKEFILE,"> Makefile2");
-print MAKEFILE '
-vpath %.c ../
-foo:
-';
-close(MAKEFILE);
-
-run_make_test(q!
+# Windows doesn't use a pipe, and doesn't close access, so this won't happen.
+if ($port_type ne 'W32') {
+    open(MAKEFILE,"> Makefile2");
+    print MAKEFILE '
+    vpath %.c ../
+    foo:
+    ';
+    close(MAKEFILE);
+
+    run_make_test(q!
 default: ; @ #MAKEPATH# -f Makefile2
 !,
               "-j2 $np",
 "#MAKE#[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
 #MAKE#[1]: Nothing to be done for 'foo'.");
 
-rmfiles('Makefile2');
+    rmfiles('Makefile2');
+}
 
 1;
 
index 6e446084e33e12259e014329052bfcdccac90a55..bbb25dd9218e074e2af9747ce2fe742026a6aff5 100644 (file)
@@ -22,17 +22,9 @@ $(shell exit 0)
 OK := $(.SHELLSTATUS)
 $(shell exit 1)
 BAD := $(.SHELLSTATUS)
-$(shell kill -2 $$$$)
-SIG := $(.SHELLSTATUS)
 all: ; @echo PRE=$(PRE) OK=$(OK) BAD=$(BAD)
               ','','PRE= OK=0 BAD=1');
 
-run_make_test('.PHONY: all
-$(shell kill -2 $$$$)
-SIG := $(.SHELLSTATUS)
-all: ; @echo SIG=$(SIG)
-              ','','SIG=130');
-
 # Test unescaped comment characters in shells.  Savannah bug #20513
 run_make_test(q!
 FOO := $(shell echo '#')
@@ -49,10 +41,10 @@ export HI = $(shell echo hi)
 all: ; @echo $$HI
     ','','hi');
 
-# Test shell errors in recipes including offset
-# This needs to be ported to Windows, or else Windows error messages
-# need to converted to look like more normal make errors.
 if ($port_type ne 'W32') {
+    # Test shell errors in recipes including offset
+    # This needs to be ported to Windows, or else Windows error messages
+    # need to converted to look like more normal make errors.
     run_make_test('
 all:
        @echo hi
@@ -60,6 +52,14 @@ all:
        @echo there
 ',
                   '', "#MAKE#: ./basdfdfsed: Command not found\nhi\nthere\n");
+
+    # Test SHELLSTATUS for kill.
+    # This test could be ported to Windows, using taskkill ... ?
+    run_make_test('.PHONY: all
+$(shell kill -2 $$$$)
+SIG := $(.SHELLSTATUS)
+all: ; @echo SIG=$(SIG)
+              ','','SIG=130');
 }
 
 1;
index fc323ce91b7d0b4fce29aa5678efae0e07290196..fcb64470dcb4402e477d4a8c35ac4ea822530ba5 100644 (file)
@@ -18,8 +18,11 @@ run_make_test("slow:;\@: no-op; echo sl\\\now\n",
 run_make_test("dquote:;\@echo \"dqu\\\note\"\n",
               '', 'dquote');
 
-run_make_test("squote:;\@echo 'squ\\\note'\n",
+# Single quotes don't behave the same in Windows
+if ($port_type ne 'W32') {
+    run_make_test("squote:;\@echo 'squ\\\note'\n",
               '', "squ\\\note");
+}
 
 # Ensure that a leading prefix character is omitted
 run_make_test("fast:;\@echo fa\\\n\tst\n",
@@ -31,8 +34,11 @@ run_make_test("slow:;\@: no-op; echo sl\\\n\tow\n",
 run_make_test("dquote:;\@echo \"dqu\\\n\tote\"\n",
               '', 'dquote');
 
-run_make_test("squote:;\@echo 'squ\\\n\tote'\n",
+# Single quotes don't behave the same in Windows
+if ($port_type ne 'W32') {
+    run_make_test("squote:;\@echo 'squ\\\n\tote'\n",
               '', "squ\\\note");
+}
 
 # Ensure that ONLY the leading prefix character is omitted
 run_make_test("fast:;\@echo fa\\\n\t  st\n",
index da9263a2560b2a96ede6cfdd74ed995cd0f743ff..a4b1128658830ba44c4301cfb5010ff0e3e53748 100644 (file)
@@ -88,7 +88,9 @@ foo bar
 foo bar');
 
 # Test the fastpath / single quotes
-run_make_test("
+# Single quotes don't behave the same in Windows
+if ($port_type ne 'W32') {
+    run_make_test("
 all:
        \@echo 'foo\\
 bar'
@@ -123,6 +125,7 @@ foo \
     bar
 foo \
     bar');
+}
 
 # Test the fastpath / double quotes
 run_make_test('
index 503b96e721d41978cd663b5239fe611efff1169e..4d677efdca1158bda788cbc80ad87f86ae4f4cfd 100644 (file)
@@ -5,6 +5,11 @@ $description = "Test proper handling of SHELL.";
 # If we don't have a POSIX shell available, never mind
 $is_posix_sh or return -1;
 
+# On Windows, shell names might not match
+if ($port_type eq 'W32') {
+    return -1;
+}
+
 $mshell = $sh_name;
 
 # According to POSIX, the value of SHELL in the environment has no impact on