]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve handling of tests in *-tests subdirs
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 12 May 2025 14:39:15 +0000 (16:39 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 12 May 2025 19:55:49 +0000 (21:55 +0200)
* test/Makefile.in (subdir_template): Add rules for *-tests subdirs.

* test/infra/Makefile.in: Remove special handling of eieio, faceup
and so-long.  Add recipes for *-tests subdirs.  Filter out rules
for *-tests subdirs.

* test/infra/test-jobs.yml: Regenerate.

(cherry picked from commit b91efd401d68f22510856008ce79121b8b9bd199)

test/Makefile.in
test/infra/Makefile.in
test/infra/test-jobs.yml

index 3d8a8b87cd9b1a53f1c58bc18124eea8e6f40998..20505432e31766e8b8a24b9120dcc22c1965cfe7 100644 (file)
@@ -258,7 +258,8 @@ SUBDIR_TARGETS =
 define subdir_template
   SUBDIR_TARGETS += check-$(subst /,-,$(1))
   .PHONY: check-$(subst /,-,$(1))
-  check-$(subst /,-,$(1)):
+  check-$(subst /,-,$(1)): \
+    $(patsubst %,check-%,$(subst /,-,$(wildcard $(1)/*-tests)))
        @${MAKE} check LOGFILES="$(patsubst %.el,%.log, \
                $(patsubst $(srcdir)/%,%,$(wildcard ${srcdir}/$(1)/*.el)))"
 endef
index 4598fe1688afbc3defd5dc7215c4ee103b34ac01..8347df4e2bf2af352c034d53a74e91a1da7229ab 100644 (file)
@@ -53,14 +53,6 @@ define subdir_template
        @echo '    - changes:' >>$(FILE)
        @echo '        - $(1)/*.{h,c}' >>$(FILE)
     endef
-    else ifeq ($(findstring eieio, $(1)), eieio)
-    define changes
-       @echo '        - lisp/emacs-lisp/eieio*.el' >>$(FILE)
-    endef
-    else ifeq ($(findstring faceup, $(1)), faceup)
-    define changes
-       @echo '        - lisp/emacs-lisp/faceup*.el' >>$(FILE)
-    endef
     else ifeq ($(findstring progmodes, $(1)), progmodes)
     define changes
        @echo '        - $(1)/eglot.el' >>$(FILE)
@@ -72,10 +64,6 @@ define subdir_template
        @echo '    - changes:' >>$(FILE)
        @echo '        - $(1)/*.el' >>$(FILE)
     endef
-    else ifeq ($(findstring so-long, $(1)), so-long)
-    define changes
-       @echo '        - lisp/so-long*.el' >>$(FILE)
-    endef
     else ifeq ($(findstring textmodes, $(1)), textmodes)
     define changes
        @echo '        - $(1)/*-ts-mode.el' >>$(FILE)
@@ -108,6 +96,9 @@ define subdir_template
        @echo '      when: never' >>$(FILE)
        @echo '    - changes:' >>$(FILE)
        $(changes)
+       $(foreach subdir, $(notdir $(wildcard ../$(1)/*-tests)),
+         @echo '        - test/$(1)/$(subdir)/*resources/**' >>$(FILE)
+         @echo '        - test/$(1)/$(subdir)/*.el' >>$(FILE))
        @echo '        - test/$(1)/*resources/**' >>$(FILE)
        @echo '        - test/$(1)/*.el' >>$(FILE)
        @echo '  variables:' >>$(FILE)
@@ -115,7 +106,8 @@ define subdir_template
        @echo '    make_params: -C test $(target)' >>$(FILE)
 endef
 
-$(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir))))
+$(foreach subdir, $(filter-out %-tests,$(SUBDIRS)), \
+  $(eval $(call subdir_template,$(subdir))))
 
 TREE-SITTER-FILES ?= $(shell cd .. ; \
   find lisp src -name "*-tests.el" | xargs grep -El "treesit.*-p" | \
index 180f29947caa6e54152853d7fcbad870d5c4a9c9..f0db97f55c0513a74803f421bc06505c8bb7ec95 100644 (file)
@@ -28,6 +28,8 @@ test-lisp-inotify:
       when: never
     - changes:
         - lisp/*.el
+        - test/lisp/so-long-tests/*resources/**
+        - test/lisp/so-long-tests/*.el
         - test/lisp/*resources/**
         - test/lisp/*.el
   variables:
@@ -147,45 +149,15 @@ test-lisp-emacs-lisp-inotify:
       when: never
     - changes:
         - lisp/emacs-lisp/*.el
-        - test/lisp/emacs-lisp/*resources/**
-        - test/lisp/emacs-lisp/*.el
-  variables:
-    target: emacs-inotify
-    make_params: -C test check-lisp-emacs-lisp
-
-test-lisp-emacs-lisp-eieio-tests-inotify:
-  stage: normal
-  extends: [.job-template, .test-template]
-  needs:
-    - job: build-image-inotify
-      optional: true
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-        - lisp/emacs-lisp/eieio*.el
         - test/lisp/emacs-lisp/eieio-tests/*resources/**
         - test/lisp/emacs-lisp/eieio-tests/*.el
-  variables:
-    target: emacs-inotify
-    make_params: -C test check-lisp-emacs-lisp-eieio-tests
-
-test-lisp-emacs-lisp-faceup-tests-inotify:
-  stage: normal
-  extends: [.job-template, .test-template]
-  needs:
-    - job: build-image-inotify
-      optional: true
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-        - lisp/emacs-lisp/faceup*.el
         - test/lisp/emacs-lisp/faceup-tests/*resources/**
         - test/lisp/emacs-lisp/faceup-tests/*.el
+        - test/lisp/emacs-lisp/*resources/**
+        - test/lisp/emacs-lisp/*.el
   variables:
     target: emacs-inotify
-    make_params: -C test check-lisp-emacs-lisp-faceup-tests
+    make_params: -C test check-lisp-emacs-lisp
 
 test-lisp-emulation-inotify:
   stage: normal
@@ -432,23 +404,6 @@ test-lisp-progmodes-inotify:
     target: emacs-inotify
     make_params: -C test check-lisp-progmodes
 
-test-lisp-so-long-tests-inotify:
-  stage: normal
-  extends: [.job-template, .test-template]
-  needs:
-    - job: build-image-inotify
-      optional: true
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-        - lisp/so-long*.el
-        - test/lisp/so-long-tests/*resources/**
-        - test/lisp/so-long-tests/*.el
-  variables:
-    target: emacs-inotify
-    make_params: -C test check-lisp-so-long-tests
-
 test-lisp-term-inotify:
   stage: normal
   extends: [.job-template, .test-template]
@@ -533,6 +488,8 @@ test-lisp-vc-inotify:
       when: never
     - changes:
         - lisp/vc/*.el
+        - test/lisp/vc/vc-tests/*resources/**
+        - test/lisp/vc/vc-tests/*.el
         - test/lisp/vc/*resources/**
         - test/lisp/vc/*.el
   variables: