GNU bug report logs - #76446
[Patch Debbugs] Infrastructure Improvements

Previous Next

Package: emacs;

Reported by: Morgan Smith <Morgan.J.Smith <at> outlook.com>

Date: Thu, 20 Feb 2025 19:07:02 UTC

Severity: wishlist

Tags: patch

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 76446 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Cc: 76446 <at> debbugs.gnu.org
Subject: Re: bug#76446:
 0001-tests-Move-helper-and-wrapper-functions-into-their-o.patch
Date: Fri, 21 Feb 2025 12:52:17 +0100
Morgan Smith <Morgan.J.Smith <at> outlook.com> writes:

> --- a/Makefile
> +++ b/Makefile
> @@ -24,7 +24,7 @@ doc: $(INFOMANUALS)
>  build: $(TARGET)
>
>  check: build $(TESTTARGET)
> -	@$(EMACS) -Q --batch -L . -l $(TESTSOURCE) -f ert-run-tests-batch-and-exit
> +	@$(EMACS) -Q --batch -L . $(foreach file,$(TESTSOURCE), -l $(file)) -f ert-run-tests-batch-and-exit

We might be better with

--8<---------------cut here---------------start------------->8---
@$(EMACS) -Q --batch -L . -L ./test -l $(TESTSOURCE) -f ert-run-tests-batch-and-exit
--8<---------------cut here---------------end--------------->8---

> --- /dev/null
> +++ b/test/debbugs-test-helpers.el
> @@ -0,0 +1,146 @@
> +(defconst debbugs-test--bug-status-soap-return
> +(defconst debbugs-test--bug-status

Perhaps we should move these data into an ert-resource file (or two).

> +(defmacro ert-deftest--debbugs (name args docstring &rest body)
> +  "The same as `ert-deftest' but runs setup and teardown functions."
> +  (declare
> +   (doc-string 3)
> +   (indent 2))
> +  `(ert-deftest ,name ,args ,docstring
> +                (debbugs-test--setup)
> +                ,@body
> +                (debbugs-test--teardown)))

In order to ensure that debbugs-test--teardown is called even in case of
errors, we could use

(unwind-protect
    (progn
      (debbugs-test--setup)
      ,@body)
  (debbugs-test--teardown))

> --- a/test/debbugs-tests.el
> +++ b/test/debbugs-tests.el
> @@ -27,118 +27,7 @@
>  ;;; Code:
>
>  (require 'debbugs)
> +(require 'debbugs-test-helpers "./test/debbugs-test-helpers")

(require 'debbugs-test-helpers) should be sufficient with the proposed
change in the Makefile.

Best regards, Michael.




This bug report was last modified 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.