summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2015-07-13 00:51:35 -0400
committerPaul Smith <psmith@gnu.org>2015-07-13 00:51:35 -0400
commit42745a900f191f67637c5c819a0672dd30b45b50 (patch)
tree9a142a1cb09bdd491ec09d824f256d29fb36ab8c /tests
parent43181f1f8241c74f68d4ff85e567c418b128c569 (diff)
* implicit.c (pattern_search): [SV 43677] Mark files secondary.
In order to fix SV 12267 we were marking the prerequisites of implicit (pattern) targets that existed elsewhere in the makefile as precious to keep them from being deleted as intermediate files. However this also keeps them from being deleted on error. Instead mark them as secondary. * tests/scripts/targets/DELETE_ON_ERROR: Test DELETE_ON_ERROR.
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/targets/DELETE_ON_ERROR22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/scripts/targets/DELETE_ON_ERROR b/tests/scripts/targets/DELETE_ON_ERROR
new file mode 100644
index 00000000..08f009fa
--- /dev/null
+++ b/tests/scripts/targets/DELETE_ON_ERROR
@@ -0,0 +1,22 @@
+#! -*-perl-*-
+
+$description = "Test the behaviour of the .DELETE_ON_ERROR target.";
+
+$details = "";
+
+run_make_test('
+.DELETE_ON_ERROR:
+all: ; false > $@
+',
+ '', "false > all\n#MAKEFILE#:3: recipe for target 'all' failed\n#MAKE#: *** [all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
+
+run_make_test('
+.DELETE_ON_ERROR:
+all: foo.x ;
+%.x : %.q ; echo > $@
+%.q : ; false > $@
+',
+ '', "false > foo.q\n#MAKEFILE#:5: recipe for target 'foo.q' failed\n#MAKE#: *** [foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
+
+# This tells the test driver that the perl test script executed properly.
+1;