]> git.eshelyaron.com Git - emacs.git/commitdiff
Skip tests if test subdir is missing
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 3 May 2019 21:19:26 +0000 (14:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 3 May 2019 21:54:38 +0000 (14:54 -0700)
Problem reported by Jeffrey Walton in:
https://lists.gnu.org/r/emacs-devel/2019-05/msg00041.html
* Makefile.in (CHECK_TARGETS): New macro; use it
to simplify 'check' and similar rules.
($(CHECK_TARGETS)): If tests are missing, do not fail
after issuing a diagnostic.  Just skip the tests.

Makefile.in

index 06da415a4abf439ca1e1c2211b2653381981401d..21362a919630c126b864b97c55607b64a9cc8d62 100644 (file)
@@ -950,17 +950,15 @@ extraclean: $(extraclean_dirs:=_extraclean)
 TAGS tags: lib lib-src # src
        $(MAKE) -C src tags
 
-.PHONY: have-tests
-have-tests:
-       @if test ! -d test; then \
-         echo "You do not seem to have the test/ directory."; \
-         echo "Maybe you are using a release tarfile, rather than a repository checkout."; \
-        exit 1; \
-       fi
-
-.PHONY: check check-maybe check-expensive check-all
-check check-maybe check-expensive check-all: have-tests all
+CHECK_TARGETS = check check-maybe check-expensive check-all
+.PHONY: $(CHECK_TARGETS)
+$(CHECK_TARGETS): all
+ifeq ($(wildcard test),test)
        $(MAKE) -C test $@
+else
+       @echo "You do not seem to have the test/ directory."
+       @echo "Maybe you used a release tarfile that lacks tests."
+endif
 
 dist:
        cd ${srcdir}; ./make-dist