summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2014-07-07 01:59:03 -0400
committerPaul Smith <psmith@gnu.org>2014-07-07 01:59:03 -0400
commit2eb63e6e43b290e84a279b24d5fcb13f2ff0cf58 (patch)
treee27af5556c7f8ff34393979ea4b2a3a206052202 /tests
parent090a8d7e038b8eae7bde2020d2a717033298896a (diff)
downloadmake-2eb63e6e43b290e84a279b24d5fcb13f2ff0cf58.tar.gz
[SV 41983] Support omitting the text argument to $(file ...)
Reported by Tim Murphy <tnmurphy@gmail.com> * function.c (func_file): Only write TEXT if it is not NULL. * NEWS, doc/make.texi: Document the new feature * tests/scripts/functions/file: Verify that the no-text version of $(file ...) works and doesn't add a newline.
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/functions/file17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/scripts/functions/file b/tests/scripts/functions/file
index 9a4cd024..55eb58a0 100644
--- a/tests/scripts/functions/file
+++ b/tests/scripts/functions/file
@@ -30,6 +30,23 @@ x:;@cat file.out
unlink('file.out');
+# Test > with no content
+run_make_test(q!
+$(file >4touch)
+.PHONY:x
+x:;@cat 4touch
+!,
+ '', '');
+
+# Test >> with no content
+run_make_test(q!
+$(file >>4touch)
+.PHONY:x
+x:;@cat 4touch
+!,
+ '', '');
+unlink('4touch');
+
# Test > to a read-only file
touch('file.out');
chmod(0444, 'file.out');