]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* tests/scripts/features/patternrules: Check unreadable file support
authorPaul Smith <psmith@gnu.org>
Tue, 26 Aug 2025 12:53:27 +0000 (08:53 -0400)
committerPaul Smith <psmith@gnu.org>
Wed, 27 Aug 2025 02:54:58 +0000 (22:54 -0400)
tests/scripts/features/patternrules

index 158a3ff2aa535defd64520a470be5719bf708b25..716cf4e24dd10dff77ac7cc44301bed88fb613ea 100644 (file)
@@ -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.