tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of $(TESTS),
authorJim Meyering <jim@meyering.net>
Sun, 16 Sep 2007 09:20:55 +0000 (11:20 +0200)
committerJim Meyering <jim@meyering.net>
Sun, 16 Sep 2007 09:29:57 +0000 (11:29 +0200)
so that "make check TESTS=test-name" works once again.

Signed-off-by: Jim Meyering <jim@meyering.net>
ChangeLog
tests/check.mk

index 5ecf759..097c2b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-09-16  Jim Meyering  <jim@meyering.net>
 
+       * tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of
+       $(TESTS), so that "make check TESTS=test-name" works once again.
+
        * tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.
 
        Revamp most test scripts.
index d358f18..91184cc 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Ensure that all version-controlled executable files are listed in TESTS.
+_v = TESTS
 vc_exe_in_TESTS: Makefile
-       @if test -d $(top_srcdir)/.git; then \
-         echo $(TESTS) | tr -s ' ' '\n' | sort -u > t1; \
+       if test -d $(top_srcdir)/.git; then                     \
+         sed -n '/^$(_v) =/,/[^\]$$/p' $(srcdir)/Makefile.am   \
+           | sed 's/^  *//;/^\$$.*/d;/^$(_v) =/d'              \
+           | tr -s '\012\\' '  ' | fmt -1 | sort -u > t1 &&    \
          for f in `$(top_srcdir)/build-aux/vc-list-files .`; do \
-           test -f "$$f" && test -x "$$f" && echo "$$f"; \
-         done | sort -u | diff -u t1 -; \
+           test -f "$$f" && test -x "$$f" && echo "$$f";       \
+         done | sort -u > t2 &&                                \
+         diff -u t1 t2 || exit 1;                              \
+         rm -f t1 t2;                                          \
        else :; fi
 
 check: vc_exe_in_TESTS