Subject: bug#76446: [Patch Debbugs v3] Infrastructure Improvements

From: Michael Albinus <[email-masked]>
Date: Mon, 24 Feb 2025 19:52:12 +0100

Morgan Smith <[email-masked]> writes:

Hi Morgan,

> I'm still not 100% sure what the ideal way to send in patches is.  Here
> is the entire v3 patch series

This is fine. Since most of the changes are not controversial, I've
committed all your patches to the debbugs repo (plus some very minor
cleanups from me).

The last point I like to discuss is the Makefile. Attached is a patch I
propose. It changes the handling of the tests more like Emacs does. Now
we have different calls:

--8<---------------cut here---------------start------------->8---
# make check
# make debbugs-tests
# make debbugs-gnu-tests
--8<---------------cut here---------------end--------------->8---

What's missing is the handling of SELECTORs like Emacs does. This we
could add later.

WDYT?

Best regards, Michael.

diff --git a/Makefile b/Makefile
index da0764ea36..bb69ebe9da 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,11 @@
 EMACS ?= emacs
 MAKEINFO ?= makeinfo

-# regex of tests to run
-TESTS=.*
-
 SOURCE=$(wildcard *.el)
 TESTSOURCE=$(wildcard test/*.el)
 TARGET=$(filter-out debbugs-pkg.elc,$(patsubst %.el,%.elc,$(SOURCE)))
 TESTTARGET=$(patsubst %.el,%.elc,$(TESTSOURCE))
+TESTS=$(patsubst test/%.el,%,$(wildcard test/*-tests.el))

 INFOMANUALS=debbugs.info debbugs-ug.info

@@ -30,10 +28,14 @@ doc: $(INFOMANUALS)
 build: $(TARGET)

 checkdoc: $(SOURCE) $(TESTSOURCE)
-	@$(EMACS) -Q --batch -l resources/debbugs-checkdoc-config.el $(foreach file,$^,"--eval=(checkdoc-file \"$(file)\")")
+	@$(EMACS) -Q --batch -l resources/debbugs-checkdoc-config.el \
+	  $(foreach file,$^,"--eval=(checkdoc-file \"$(file)\")")
+
+check: $(TESTS)

-check: build $(TESTTARGET)
-	@$(EMACS) -Q --batch -L . -L ./test $(foreach file,$(TESTSOURCE), -l $(file)) --eval '(ert-run-tests-batch-and-exit "$(TESTS)")'
+%-tests: build $(TESTTARGET)
+	@$(EMACS) -Q --batch -L . -L ./test -l $@ \
+	  --eval '(ert-run-tests-batch-and-exit t)'

 clean:
 	-rm -f $(TARGET) $(TESTTARGET) $(INFOMANUALS)