From: Paul Smith Date: Tue, 26 Aug 2025 12:53:27 +0000 (-0400) Subject: * tests/scripts/features/patternrules: Check unreadable file support X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6efbb37b7a09f2bf44d8ae7a0aa165644ea44a85;p=thirdparty%2Fmake.git * tests/scripts/features/patternrules: Check unreadable file support --- diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules index 158a3ff2..716cf4e2 100644 --- a/tests/scripts/features/patternrules +++ b/tests/scripts/features/patternrules @@ -673,25 +673,27 @@ $r%.x: $dollar\$(wordlist 1, 99, ${prefix}%${suffix}.1 ${prefix}%${suffix}.2); \ } # 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"); - -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"); - -chmod(0754, 'b'); -unlink('b/hello.q'); -rmdir('b'); +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'); + + 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'); +} # SV 66273. An explicitly mentioned prerequisite is not intermediate, even in # the case of double colon.