emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/swift-mode 97d86cd 326/496: Tweak test runner


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 97d86cd 326/496: Tweak test runner
Date: Sun, 29 Aug 2021 11:34:00 -0400 (EDT)

branch: elpa/swift-mode
commit 97d86cd5f2aae4acba75b0b7f56dcb736a8c2d09
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>

    Tweak test runner
---
 test/swift-mode-test-indent.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/test/swift-mode-test-indent.el b/test/swift-mode-test-indent.el
index aee43d6..a3b21c1 100644
--- a/test/swift-mode-test-indent.el
+++ b/test/swift-mode-test-indent.el
@@ -41,14 +41,14 @@
   "Initialize and switch to the error buffer.
 
 Return the error-buffer"
-  (switch-to-buffer (get-buffer-create "*swift-mode-test-indent*"))
+  (pop-to-buffer (get-buffer-create "*swift-mode-test-indent*"))
   (fundamental-mode)
   (setq buffer-read-only nil)
   (erase-buffer)
   (current-buffer))
 
 (defun swift-mode:run-test:indent ()
-  "Run indentation test for swift-mode."
+  "Run indentation test for `swift-mode'."
   (interactive)
   (let ((error-buffer
          (if noninteractive nil (swift-mode:setup-error-buffer)))
@@ -57,18 +57,23 @@ Return the error-buffer"
                        (cons 'error 0)
                        (cons 'warning 0)
                        (cons 'info 0)
-                       (cons 'ok 0))))
+                       (cons 'ok 0)))
+        (progress-reporter (unless noninteractive
+                             (make-progress-reporter "Running tests..."))))
     (setq default-directory
           (concat (file-name-as-directory swift-mode:test:basedir)
                   "swift-files"))
 
     (dolist (swift-file (file-expand-wildcards "*.swift"))
+      (redisplay)
       (with-temp-buffer
         (switch-to-buffer (current-buffer))
         (insert-file-contents-literally swift-file)
         (swift-mode)
         (setq current-line 0)
         (while (not (eobp))
+          (when (not noninteractive)
+            (progress-reporter-update progress-reporter))
           (setq current-line (1+ current-line))
           (cond
            ((looking-at ".*//.*swift-mode:test:keep-indent")
@@ -88,6 +93,9 @@ Return the error-buffer"
               (setcdr count-assoc (1+ (cdr count-assoc))))))
           (forward-line))))
 
+    (when (not noninteractive)
+      (progress-reporter-done progress-reporter))
+
     (swift-mode:print-message
      error-buffer
      (concat
@@ -174,6 +182,7 @@ Otherwise, MESSAGE is appended to the ERROR-BUFFER."
   (if noninteractive
       (princ message)
     (with-current-buffer error-buffer
+      (goto-char (point-max))
       (insert-and-inherit message))))
 
 (provide 'swift-mode-test-indent)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]