chiark / gitweb /
tests/example/check: Better handling of makefile updates
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 29 Dec 2019 11:01:28 +0000 (11:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 29 Dec 2019 16:04:44 +0000 (16:04 +0000)
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>
tests/example/check

index a5b27ba043da0ce0485ff9ad9a509747557f21ee..85735afe094684e6907ba3e7428d5a35da65bdcd 100755 (executable)
@@ -26,12 +26,12 @@ make -j4 all check
 
 #----- 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.