# Try failing due to non-executable file
-my $noexe = './barfooblatboz';
-touch($noexe);
-
-run_make_test(qq!
-one: ; -$noexe xx yy
-two: ; $noexe aa bb
-!,
- 'one', "$noexe xx yy\n#MAKE#: $noexe: Permission denied\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n");
-
-unlink($noexe);
+if ($ERR_nonexe_file) {
+ my $noexe = './barfooblatboz';
+ touch($noexe);
+
+ run_make_test(qq!
+ one: ; -$noexe xx yy
+ two: ; $noexe aa bb
+ !,
+ 'one', "$noexe xx yy\n#MAKE#: $noexe: $ERR_nonexe_file\n#MAKE#: [#MAKEFILE#;2: one] Error 127 (ignored)\n");
+
+ unlink($noexe);
+}
1;
$ERR_no_such_file = undef;
$ERR_read_only_file = undef;
$ERR_unreadable_file = undef;
+$ERR_noexe_file = undef;
if (open(my $F, '<', 'file.none')) {
print "Opened non-existent file! Skipping related tests.\n";
$ERR_read_only_file = "$!";
}
+$_ = `./file.out`;
+if ($? == 0) {
+ print "Executed non-executable file! Skipping related tests.\n";
+} else {
+ $ERR_nonexe_file = "$!";
+}
+
chmod(0000, 'file.out');
if (open(my $F, '<', 'file.out')) {
print "Opened unreadable file! Skipping related tests.\n";