[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/08: guix: emacs-utils: Add ert-number-tests.
From: |
guix-commits |
Subject: |
05/08: guix: emacs-utils: Add ert-number-tests. |
Date: |
Sat, 26 Aug 2023 01:04:33 -0400 (EDT) |
lilyp pushed a commit to branch emacs-team
in repository guix.
commit 50b2db40ea03d8b3c78b3a774e057ebab0f98790
Author: Liliana Marie Prikler <liliana.prikler@gmail.com>
AuthorDate: Sat Aug 19 01:37:20 2023 +0200
guix: emacs-utils: Add ert-number-tests.
* 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 @@
emacs-byte-compile-directory
emacs-compile-directory
emacs-header-parse
+ ert-number-tests
as-display
emacs-substitute-sexps
@@ -183,6 +184,19 @@ If native code is not supported, compile to bytecode
instead."
(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
- branch emacs-team updated (d58c6e25ff -> ca7e310f7a), guix-commits, 2023/08/26
- 06/08: gnu: emacs-libgit: Fix build., guix-commits, 2023/08/26
- 01/08: gnu: emacs-php-mode: Update to 1.25.0., guix-commits, 2023/08/26
- 03/08: gnu: emacs-haskell-mode: Update to 17.4., guix-commits, 2023/08/26
- 05/08: guix: emacs-utils: Add ert-number-tests.,
guix-commits <=
- 08/08: gnu: emacs-yasnippet: Fix build., guix-commits, 2023/08/26
- 04/08: gnu: emacs-helpful: Update to 0.21., guix-commits, 2023/08/26
- 02/08: gnu: emacs-all-the-icons: Honour #:tests?, guix-commits, 2023/08/26
- 07/08: gnu: emacs-all-the-icons: Fix build., guix-commits, 2023/08/26