summaryrefslogtreecommitdiff
path: root/tests/scripts/features/include
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2016-12-25 17:41:50 -0500
committerPaul Smith <psmith@gnu.org>2016-12-26 09:01:59 -0500
commitc5ccc4930c3805604813def4455bc2e90635349e (patch)
treef0c2c966e217dc4accfa38c34c7296211dadc93b /tests/scripts/features/include
parent45bf0e3a6757a565dd15050ae46b42a3d534477b (diff)
downloadmake-git-c5ccc4930c3805604813def4455bc2e90635349e.tar.gz
[SV 40236] Handle included file open failures properly.
* read.c (eval_makefile): Set deps->error if we discovered any error reading makefiles, and set NONEXISTENT_MTIME so we know it needs to be rebuilt. * main.c (main): Clean up management of makefile_mtimes. * tests/scripts/features/include: Add open failure testcases.
Diffstat (limited to 'tests/scripts/features/include')
-rw-r--r--tests/scripts/features/include30
1 files changed, 19 insertions, 11 deletions
diff --git a/tests/scripts/features/include b/tests/scripts/features/include
index a21455dd..fe404ad9 100644
--- a/tests/scripts/features/include
+++ b/tests/scripts/features/include
@@ -235,17 +235,25 @@ inc1: foo; echo > $@
rmfiles('inc1');
-# include a directory
-
-if ($all_tests) {
- # Test that include of a rebuild-able file doesn't show a warning
- # Savannah bug #102
- run_make_test(q!
-include foo
-foo: ; @echo foo = bar > $@
+# Including files that can't be read should show an error
+create_file('inc1', 'FOO := foo');
+chmod 0000, 'inc1';
+
+run_make_test(q!
+include inc1
+all:;@echo $(FOO)
!,
- '', "#MAKE#: 'foo' is up to date.\n");
- rmfiles('foo');
-}
+ '', "#MAKEFILE#:2: inc1: $ERR_unreadable_file\n#MAKE#: *** No rule to make target 'inc1'. Stop.", 512);
+
+# Unreadable files that we know how to successfully recreate should work
+
+run_make_test(sprintf(q!
+all:;@echo $(FOO)
+include inc1
+inc1:; @%s $@ && echo FOO := bar > $@
+!, $CMD_rmfile),
+ '', "bar");
+
+rmfiles('inc1');
1;