From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 65376@debbugs.gnu.org
Cc: andrew@trop.in, liliana.prikler@gmail.com
Subject: [bug#65376] [PATCH emacs-team 4/7] guix: emacs-utils: Add ert-number-tests.
Date: Sat, 19 Aug 2023 01:37:20 +0200 [thread overview]
Message-ID: <50b2db40ea03d8b3c78b3a774e057ebab0f98790.1692427560.git.liliana.prikler@gmail.com> (raw)
In-Reply-To: <cover.1692427560.git.liliana.prikler@gmail.com>
* guix/build/utils.scm (ert-number-tests): New variable.
---
guix/build/emacs-utils.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 850b1f5f2a..ac3dac57d1 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -40,6 +40,7 @@ (define-module (guix build emacs-utils)
emacs-byte-compile-directory
emacs-compile-directory
emacs-header-parse
+ ert-number-tests
as-display
emacs-substitute-sexps
@@ -183,6 +184,19 @@ (define-syntax replacement-helper
(insert " ")
(insert ,(format #f "~s" replacement))))))
+(define (ert-number-tests file test-name)
+ "Add a numerically increasing suffix to tests of the same name.
+This fixes test errors of the pattern \"Test TEST_NAME redefined\"."
+ (emacs-batch-edit-file file
+ `(let ((i 0))
+ (while (re-search-forward ,(string-append "ert-deftest " test-name)
+ nil t)
+ (goto-char (match-beginning 0))
+ (kill-region (match-beginning 0) (match-end 0))
+ (insert (format "ert-deftest %s-%d" ,test-name i))
+ (setq i (+ i 1)))
+ (basic-save-buffer))))
+
(define-syntax emacs-substitute-sexps
(syntax-rules ()
"Substitute the S-expression immediately following the first occurrence of
--
2.41.0
next prev parent reply other threads:[~2023-08-19 8:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 6:46 [bug#65376] [PATCH emacs-team 0/7] Fix some more builds Liliana Marie Prikler
2023-08-18 22:22 ` [bug#65376] [PATCH emacs-team 1/7] gnu: emacs-all-the-icons: Honour #:tests? Liliana Marie Prikler
2023-08-18 22:52 ` [bug#65376] [PATCH emacs-team 2/7] gnu: emacs-haskell-mode: Update to 17.4 Liliana Marie Prikler
2023-08-18 23:05 ` [bug#65376] [PATCH emacs-team 3/7] gnu: emacs-helpful: Update to 0.21 Liliana Marie Prikler
2023-08-18 23:37 ` Liliana Marie Prikler [this message]
2023-08-18 23:37 ` [bug#65376] [PATCH emacs-team 5/7] gnu: emacs-libgit: Fix build Liliana Marie Prikler
2023-08-18 23:55 ` [bug#65376] [PATCH emacs-team 6/7] gnu: emacs-all-the-icons: " Liliana Marie Prikler
2023-08-19 6:40 ` [bug#65376] [PATCH emacs-team 7/7] gnu: emacs-yasnippet: " Liliana Marie Prikler
2023-08-20 16:53 ` [bug#65376] [PATCH emacs-team 0/7] Fix some more builds Andrew Tropin
2023-09-07 18:22 ` bug#65376: " Liliana Marie Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50b2db40ea03d8b3c78b3a774e057ebab0f98790.1692427560.git.liliana.prikler@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=65376@debbugs.gnu.org \
--cc=andrew@trop.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.