summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/features/include64
-rw-r--r--tests/scripts/options/dash-B6
-rw-r--r--tests/scripts/options/dash-W7
-rw-r--r--tests/scripts/options/print-directory4
-rw-r--r--tests/scripts/variables/MAKE_RESTARTS9
5 files changed, 79 insertions, 11 deletions
diff --git a/tests/scripts/features/include b/tests/scripts/features/include
index ee014bd8..f78563f9 100644
--- a/tests/scripts/features/include
+++ b/tests/scripts/features/include
@@ -165,6 +165,70 @@ baz: end
#MAKE#: *** No rule to make target 'end', needed by 'baz'. Stop.\n",
512);
+# Test include of make-able file doesn't show an error (Savannah #102)
+run_make_test(q!
+.PHONY: default
+default:; @echo DONE
+
+inc1:; echo > $@
+include inc1
+include inc2
+inc2:; echo > $@
+!,
+ '', "echo > inc2\necho > inc1\nDONE\n");
+
+rmfiles('inc1', 'inc2');
+
+# Test include of non-make-able file does show an error (Savannah #102)
+run_make_test(q!
+.PHONY: default
+default:; @echo DONE
+
+inc1:; echo > $@
+include inc1
+include inc2
+!,
+ '', "#MAKEFILE#:7: inc2: No such file or directory\n#MAKE#: *** No rule to make target 'inc2'. Stop.\n", 512);
+
+rmfiles('inc1');
+
+# Include same file multiple times
+
+run_make_test(q!
+default:; @echo DEFAULT
+include inc1
+inc1:; echo > $@
+include inc1
+!,
+ '', "echo > inc1\nDEFAULT\n");
+
+rmfiles('inc1');
+
+# Included file has a prerequisite that fails to build
+
+run_make_test(q!
+default:; @echo DEFAULT
+include inc1
+inc1: foo; echo > $@
+foo:; exit 1
+!,
+ '', "exit 1\n#MAKEFILE#:3: inc1: No such file or directory\n#MAKE#: *** [#MAKEFILE#:5: foo] Error 1\n", 512);
+
+rmfiles('inc1');
+
+# Included file has a prerequisite we don't know how to build
+
+run_make_test(q!
+default:; @echo DEFAULT
+include inc1
+inc1: foo; echo > $@
+!,
+ '', "#MAKEFILE#:3: inc1: No such file or directory\n#MAKE#: *** No rule to make target 'foo', needed by 'inc1'. Stop.\n", 512);
+
+rmfiles('inc1');
+
+# include a directory
+
if ($all_tests) {
# Test that include of a rebuild-able file doesn't show a warning
# Savannah bug #102
diff --git a/tests/scripts/options/dash-B b/tests/scripts/options/dash-B
index 9c708b77..4c4c4cfb 100644
--- a/tests/scripts/options/dash-B
+++ b/tests/scripts/options/dash-B
@@ -45,7 +45,6 @@ include foo.x
foo.x: ; @touch $@
',
'-B', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1');
rmfiles('foo.x');
@@ -63,7 +62,6 @@ foo.x: ; @touch $@
blah.x: ; @echo $@
',
'-B', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1
blah.x
all');
@@ -83,3 +81,7 @@ x.a: x.b ; @echo $?
unlink(qw(x.a x.b));
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/options/dash-W b/tests/scripts/options/dash-W
index 20b9f745..857b1cce 100644
--- a/tests/scripts/options/dash-W
+++ b/tests/scripts/options/dash-W
@@ -42,8 +42,7 @@ foo.x: bar.x
bar.x: ; echo >> $@
baz.x: bar.x ; @echo "touch $@"
',
- '', '#MAKEFILE#:3: foo.x: No such file or directory
-echo >> bar.x
+ '', 'echo >> bar.x
touch foo.x
restarts=1
touch baz.x');
@@ -86,3 +85,7 @@ unlink(qw(y x-dir/x));
rmdir('x-dir');
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End:
diff --git a/tests/scripts/options/print-directory b/tests/scripts/options/print-directory
index a05bbee7..db762b2c 100644
--- a/tests/scripts/options/print-directory
+++ b/tests/scripts/options/print-directory
@@ -18,7 +18,7 @@ include foo
all: ;@:
foo: ; touch foo
!,
- "", "#MAKEFILE#:2: foo: No such file or directory\ntouch foo\n");
+ "", "touch foo\n");
unlink('foo');
# Test makefile rebuild with -w
@@ -27,7 +27,7 @@ include foo
all: ;@:
foo: ; touch foo
!,
- "-w", "#MAKE#: Entering directory '#PWD#'\n#MAKEFILE#:2: foo: No such file or directory\ntouch foo\n#MAKE#: Leaving directory '#PWD#'\n");
+ "-w", "#MAKE#: Entering directory '#PWD#'\ntouch foo\n#MAKE#: Leaving directory '#PWD#'\n");
unlink('foo');
1;
diff --git a/tests/scripts/variables/MAKE_RESTARTS b/tests/scripts/variables/MAKE_RESTARTS
index ef8e368f..01bf55ec 100644
--- a/tests/scripts/variables/MAKE_RESTARTS
+++ b/tests/scripts/variables/MAKE_RESTARTS
@@ -11,7 +11,6 @@ include foo.x
foo.x: ; @touch $@
',
'', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1');
rmfiles('foo.x');
@@ -26,9 +25,7 @@ foo.x: ; @echo "include bar.x" > $@
bar.x: ; @touch $@
',
'', 'MAKE_RESTARTS=
-#MAKEFILE#:4: foo.x: No such file or directory
MAKE_RESTARTS=1
-foo.x:1: bar.x: No such file or directory
MAKE_RESTARTS=2');
rmfiles('foo.x', 'bar.x');
@@ -47,9 +44,7 @@ foo.x: ; @echo "include bar.x" > $@
bar.x: ; @touch $@
',
'', "MAKE_RESTARTS=
-#MAKEFILE#:8: foo.x: No such file or directory
MAKE_RESTARTS=1
-foo.x:1: bar.x: No such file or directory
MAKE_RESTARTS=2
recurse MAKE_RESTARTS=
#MAKE#[1]: Entering directory '#PWD#'
@@ -60,3 +55,7 @@ all MAKE_RESTARTS=
rmfiles('foo.x', 'bar.x');
1;
+
+### Local Variables:
+### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
+### End: