From 6efbb37b7a09f2bf44d8ae7a0aa165644ea44a85 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 26 Aug 2025 08:53:27 -0400 Subject: [PATCH] * tests/scripts/features/patternrules: Check unreadable file support --- tests/scripts/features/patternrules | 40 +++++++++++++++-------------- 1 file changed, 21 insertions(+), 19 deletions(-) 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. -- 2.47.3