[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#65376] [PATCH emacs-team 4/7] guix: emacs-utils: Add ert-number-tes
From: |
Liliana Marie Prikler |
Subject: |
[bug#65376] [PATCH emacs-team 4/7] guix: emacs-utils: Add ert-number-tests. |
Date: |
Sat, 19 Aug 2023 01:37:20 +0200 |
* 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
- [bug#65376] [PATCH emacs-team 0/7] Fix some more builds, Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 2/7] gnu: emacs-haskell-mode: Update to 17.4., Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 1/7] gnu: emacs-all-the-icons: Honour #:tests?, Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 3/7] gnu: emacs-helpful: Update to 0.21., Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 7/7] gnu: emacs-yasnippet: Fix build., Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 4/7] guix: emacs-utils: Add ert-number-tests.,
Liliana Marie Prikler <=
- [bug#65376] [PATCH emacs-team 6/7] gnu: emacs-all-the-icons: Fix build., Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 5/7] gnu: emacs-libgit: Fix build., Liliana Marie Prikler, 2023/08/19
- [bug#65376] [PATCH emacs-team 0/7] Fix some more builds, Andrew Tropin, 2023/08/20