Rather than checking just for presence of a string in a templated
output file, also have the input file define a target which we try to
run. This checks that make actually reread the file.
Also add ||false to the grep lines, which makes the stderr output
more obviously contain a failure when the test fails.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
#----- testing rebuild on input change -----
-echo '# for-check 1' >>../src/for-test.sd.mk
-make -j4
-grep '^# for-check 1' src/Subdir.mk || false
+echo 'for-check-1:' >>../src/for-test.sd.mk
+make -j4 for-check-1
+grep '^for-check-1:' src/Subdir.mk || false
-echo '# for-check 2' >>../lib/for-test.mk.in
-make -j4
-grep '^# for-check 2' lib/for-test.mk || false
+echo 'for-check-2:' >>../lib/for-test.mk.in
+make -j4 for-check-2
+grep '^for-check-2:' lib/for-test.mk || false
echo ok.