emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 39a6584: Add new targets to test/Makefile


From: Michael Albinus
Subject: master 39a6584: Add new targets to test/Makefile
Date: Sun, 17 Jan 2021 07:38:14 -0500 (EST)

branch: master
commit 39a65844e8d67b5ca3bb2d179e899ff99cd85618
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Add new targets to test/Makefile
    
    * test/Makefile.in (SUBDIRS): New variable.
    (subdir_template): New template.
    (top) Create new check-<dirname> targets.
    
    * test/README: Document them.
    
    * test/infra/gitlab-ci.yml (test-lisp-net-inotify): Rename.
---
 test/Makefile.in         | 20 +++++++++++++-------
 test/README              |  9 ++++-----
 test/infra/gitlab-ci.yml |  4 ++--
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/test/Makefile.in b/test/Makefile.in
index 2d595d9..4ca43c8 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -246,11 +246,17 @@ endef
 
 $(foreach test,${TESTS},$(eval $(call test_template,${test})))
 
-# Get the tests for only a specific directory
-NET_TESTS := $(patsubst %.el,%,$(wildcard lisp/net/*.el))
-LISP_TESTS := $(patsubst %.el,%,$(wildcard lisp/*.el))
-check-net: ${NET_TESTS}
-check-lisp: ${LISP_TESTS}
+## Get the tests for only a specific directory.
+SUBDIRS = $(sort $(shell find lisp src -type d ! -path "*resources*" -print))
+
+define subdir_template
+  .PHONY: check-$(subst /,-,$(1))
+  check-$(subst /,-,$(1)):
+       @${MAKE} check LOGFILES="$(patsubst %.el,%.log, \
+               $(patsubst $(srcdir)/%,%,$(wildcard $(1)/*.el)))"
+endef
+
+$(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir))))
 
 ifeq (@HAVE_MODULES@, yes)
 # -fPIC is a no-op on Windows, but causes a compiler warning
@@ -318,10 +324,10 @@ check-doit:
 ifeq ($(TEST_INTERACTIVE), yes)
        HOME=$(TEST_HOME) $(emacs) \
          -l ert ${ert_opts} \
-         $(patsubst %,-l %,$(if $(findstring 
$(TEST_LOAD_EL),yes),$ELFILES,$(ELFILES:.el=)))  \
+         $(patsubst %,-l %,$(if $(findstring 
$(TEST_LOAD_EL),yes),$ELFILES,$(ELFILES:.el=))) \
          $(TEST_RUN_ERT)
 else
-       -@${MAKE} -k  ${LOGFILES}
+       -@${MAKE} -k ${LOGFILES}
        @$(emacs) --batch -l ert --eval \
        "(ert-summarize-tests-batch-and-exit ${SUMMARIZE_TESTS})" ${LOGFILES}
 endif
diff --git a/test/README b/test/README
index 38f4a10..58f5f38 100644
--- a/test/README
+++ b/test/README
@@ -39,11 +39,10 @@ The Makefile in this directory supports the following 
targets:
 * make check-all
   Like "make check", but run all tests.
 
-* make check-lisp
-  Like "make check", but run only the tests in test/lisp/*.el
-
-* make check-net
-  Like "make check", but run only the tests in test/lisp/net/*.el
+* make check-<dirname>
+  Like "make check", but run only the tests in test/<dirname>/*.el.
+  <dirname> is a relative directory path, which has replaced "/" by "-",
+  like in "check-src" or "check-lisp-net".
 
 * make <filename>  -or-  make <filename>.log
   Run all tests declared in <filename>.el.  This includes expensive
diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml
index f9c0e0c..b8d068a 100644
--- a/test/infra/gitlab-ci.yml
+++ b/test/infra/gitlab-ci.yml
@@ -182,12 +182,12 @@ test-lisp-inotify:
     target: emacs-inotify
     make_params: "-C test check-lisp"
 
-test-net-inotify:
+test-lisp-net-inotify:
   stage: normal
   extends: [.job-template, .test-template]
   variables:
     target: emacs-inotify
-    make_params: "-C test check-net"
+    make_params: "-C test check-lisp-net"
 
 test-filenotify-gio:
   # This tests file monitor libraries gfilemonitor and gio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]