Update regression tests for Windows.

* 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.
This commit is contained in:
Paul Smith 2018-07-01 16:13:13 -04:00 committed by Paul Smith
parent 1dfd55ca36
commit c808f10d08
5 changed files with 40 additions and 24 deletions

View 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
# 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);
open(MAKEFILE,"> Makefile2");
print MAKEFILE '
vpath %.c ../
foo:
';
close(MAKEFILE);
run_make_test(q!
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;

View 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;

View 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",

View 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('

View 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