* tests/scripts/features/patternrules: Check unreadable file support
diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules index 158a3ff..716cf4e 100644 --- a/tests/scripts/features/patternrules +++ b/tests/scripts/features/patternrules
@@ -673,25 +673,27 @@ } # SV 66268. An error message about a failure to remove an intermediate file. -run_make_test(q! -all: hello.x -%.x: b/%.q; $(info $@ from $<) -b/%.q:; @mkdir b; touch $@; chmod -w b -!, '', "hello.x from b/hello.q\nrm b/hello.q\n#MAKE#: unlink: b/hello.q: $ERR_unreadable_file\n"); +if (defined $ERR_unreadable_file) { + run_make_test(q! + all: hello.x + %.x: b/%.q; $(info $@ from $<) + b/%.q:; @mkdir b; touch $@; chmod -w b + !, '', "hello.x from b/hello.q\nrm b/hello.q\n#MAKE#: unlink: b/hello.q: $ERR_unreadable_file\n"); -chmod(0754, 'b'); -unlink('b/hello.q'); -rmdir('b'); + chmod(0754, 'b'); + unlink('b/hello.q'); + rmdir('b'); -run_make_test(q! -all: hello.x -%.x: b/%.q; $(info $@ from $<) -b/%.q:; @mkdir b; touch $@; chmod -w b -!, '-s', "hello.x from b/hello.q\n#MAKE#: unlink: b/hello.q: $ERR_unreadable_file\n"); + run_make_test(q! + all: hello.x + %.x: b/%.q; $(info $@ from $<) + b/%.q:; @mkdir b; touch $@; chmod -w b + !, '-s', "hello.x from b/hello.q\n#MAKE#: unlink: b/hello.q: $ERR_unreadable_file\n"); -chmod(0754, 'b'); -unlink('b/hello.q'); -rmdir('b'); + chmod(0754, 'b'); + unlink('b/hello.q'); + rmdir('b'); +} # SV 66273. An explicitly mentioned prerequisite is not intermediate, even in # the case of double colon.