$ERR_nonexe_file = "$!";
}
- $_ = `./. 2>&1`;
- if ($? == 0) {
- print "Executed directory! Skipping related tests.\n";
+ if ($^O =~ /cygwin/i) {
+ # For some reason the execute here gives a different answer than make's
+ print "Skipping directory execution on $^O\n";
} else {
- $ERR_exe_dir = "$!";
+ $_ = `./. 2>&1`;
+ if ($? == 0) {
+ print "Executed directory! Skipping related tests.\n";
+ } else {
+ $ERR_exe_dir = "$!";
+ }
}
chmod(0000, 'file.out');
# Try failing by "running" a directory
if ($ERR_exe_dir) {
- mkdir('sd', 0775);
+ mkdir('sd', 0775) or print "mkdir: sd: $!\n";
run_make_test(q!
PATH := .
# Only bother with this on UNIX systems
$port_type eq 'UNIX' or return -1;
+$^O =~ /cygwin/ and return -1;
my $usersh = $origENV{SHELL};
my $answer = 'hello, world';
close(CMD);
chmod 0700, $cmd;
- run_make_test("# $shbang\n# $shell" . q!
+ run_make_test("# shbang=$shbang\n# shell=$shell" . q!
all:; @$(CMD)
!, "$shell CMD=$cmd", "$answer\n");
all: hello$s
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-hello.c:; false
-", '-r', "false\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
+hello.c:; @#HELPER# fail 1
+", '-r', "fail 1\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
# Test that make finds the intended implicit rule based on existence of a
# prerequisite in the filesystem, even when the prerequisite of another
all: hello$s
%$s:$r %.c; \$(info \$<)
%$s:$r %.f; \$(info \$<)
-.DEFAULT:; \$(info \$\@) false
+.DEFAULT:; \@\$(info \$\@) #HELPER# fail 1
unrelated: hello.c
-", '-r', "hello.c\nfalse\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
+", '-r', "hello.c\nfail 1\n#MAKE#: *** [#MAKEFILE#:5: hello.c] Error 1\n", 512);
# hello.f is missing.
# No rule is found, because hello.c is not mentioned explicitly.
all: hello$s
%$s:$r %.c; \$(info \$<)
%$s:$r %.f; \$(info \$<)
-.DEFAULT:; \@\$(info \$\@) false
-", '-r', "hello$s\n#MAKE#: *** [#MAKEFILE#:5: hello$s] Error 1\n", 512);
+.DEFAULT:; \@\$(info \$\@) #HELPER# fail 1
+", '-r', "hello$s\nfail 1\n#MAKE#: *** [#MAKEFILE#:5: hello$s] Error 1\n", 512);
}
}
my $result = "#MAKE#: *** No rule to make target 'hello.tsk', needed by 'all'. Stop.\n";
if ($s or $r) {
- $result = "false\n#MAKE#: *** [#MAKEFILE#:6: hello.c] Error 1\n";
+ $result = "fail 1\n#MAKE#: *** [#MAKEFILE#:6: hello.c] Error 1\n";
}
run_make_test("
%.tsk: %$s; \$(info hello.tsk)
%$s:$r %.c; \$(info hello.c)
%$s:$r %.f; \$(info hello.f)
-hello.c:; false
+hello.c:; @#HELPER# fail 1
", '-r', $result, 512);
}
}
load testapi.so
$extra_loads
all:; \$(info \$(test-expand hello))
-testapi.so: force; false
+testapi.so: force; @#HELPER# fail 1
force:;
.PHONY: force
-", '', "testapi_gmk_setup\nfalse\n#MAKE#: *** [#MAKEFILE#:$n: testapi.so] Error 1\n", 512);
+", '', "testapi_gmk_setup\nfail 1\n#MAKE#: *** [#MAKEFILE#:$n: testapi.so] Error 1\n", 512);
# sv 63045.
# Same as above, but testapi_gmk_setup returned -1.
load testapi.so
$extra_loads
all:; \$(info \$(test-expand hello))
-testapi.so: force; false
+testapi.so: force; @#HELPER# fail 1
force:;
.PHONY: force
", '', "testapi_gmk_setup\nhello\n#MAKE#: 'all' is up to date.\n");
close(MAKEFILE);
# Test per-make synchronization.
+# Note we have to sleep again here after starting the foo makefile before
+# starting the bar makefile, otherwise the "entering/leaving" messages for the
+# submakes might be ordered differently than we expect.
+
unlink(@syncfiles);
run_make_test(qq!
all: make-foo make-bar
make-foo: ; \$(MAKE) -C foo
-make-bar: ; \$(MAKE) -C bar!,
+make-bar: ; #HELPER# -q sleep 1 ; \$(MAKE) -C bar!,
'-j -Orecurse',
"#MAKEPATH# -C foo
#MAKE#[1]: Entering directory '#PWD#/foo'
foo: start
foo: end
#MAKE#[1]: Leaving directory '#PWD#/foo'
-#MAKEPATH# -C bar
+#HELPER# -q sleep 1 ; #MAKEPATH# -C bar
#MAKE#[1]: Entering directory '#PWD#/bar'
bar: start
bar: end
$description = "Make sure make exits with an error if fopen fails.";
+# For some reason on Cygwin, make exits with no error message after
+# it recurses for a while.
+$^O =~ /cygwin/ and return -1;
+
# Recurse infinitely until we run out of open files, and ensure we
# fail with a non-zero exit code. Don't bother to test the output
# since it's hard to know what it will be, exactly.
# Only run these tests if the system sypports symlinks
-# Apparently the Windows port of Perl reports that it does support symlinks
-# (in that the symlink() function doesn't fail) but it really doesn't, so
-# check for it explicitly.
-
-if ($port_type eq 'W32' || !( eval { symlink("",""); 1 })) {
- # This test is N/A
- return -1;
-}
+exists $FEATURES{'check-symlink'} or return -1;
use File::Spec;
$| = 1;
my $quiet = 0;
-my $timeout = 4;
+my $timeout = 10;
sub op {
my ($op, $nm) = @_;