[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 60dab9b 308/496: Update test to return informat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 60dab9b 308/496: Update test to return informative exit status |
Date: |
Sun, 29 Aug 2021 11:33:57 -0400 (EDT) |
branch: elpa/swift-mode
commit 60dab9b1f728466857fadd5268524303b56c5a2b
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>
Update test to return informative exit status
---
test/swift-mode-test-indent.el | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/test/swift-mode-test-indent.el b/test/swift-mode-test-indent.el
index caad818..476b568 100644
--- a/test/swift-mode-test-indent.el
+++ b/test/swift-mode-test-indent.el
@@ -53,7 +53,7 @@ Return the error-buffer"
(let ((error-buffer
(if noninteractive nil (swift-mode:setup-error-buffer)))
(current-line 0)
- (error-count 0))
+ (error-counts '((error . 0) (warning . 0) (info . 0) (ok . 0))))
(setq default-directory
(concat (file-name-as-directory swift-mode:test:basedir)
"swift-files"))
@@ -77,14 +77,23 @@ Return the error-buffer"
(t
(when (looking-at ".*//.*swift-mode:test:eval\\(.*\\)")
(eval-region (match-beginning 1) (match-end 1)))
- (unless
- (swift-mode:test-current-line-indent
- swift-file current-line error-buffer)
- (setq error-count (1+ error-count)))))
+ (let*
+ ((status (swift-mode:test-current-line-indent
+ swift-file current-line error-buffer))
+ (count-assoc (assq status error-counts)))
+ (setcdr count-assoc (1+ (cdr count-assoc))))))
(forward-line))))
- (when (= error-count 0)
- (swift-mode:print-message error-buffer "no regressions\n"))
- (when (not noninteractive)
+
+ (swift-mode:print-message
+ error-buffer
+ (concat
+ "Errors: " (prin1-to-string (assoc-default 'error error-counts)) "\n"
+ "Warning: " (prin1-to-string (assoc-default 'warning error-counts)) "\n"
+ "Info: " (prin1-to-string (assoc-default 'info error-counts)) "\n"
+ "OK: " (prin1-to-string (assoc-default 'ok error-counts)) "\n"))
+
+ (if noninteractive
+ (kill-emacs (min 63 (assoc-default 'error error-counts)))
(compilation-mode))))
(defun swift-mode:test-current-line-indent
@@ -97,7 +106,8 @@ ERROR-BUFFER is the buffer to output errors."
(back-to-indentation)
(let ((original-indent (current-column))
computed-indent
- (known-bug (looking-at ".*//.*swift-mode:test:known-bug")))
+ (known-bug (looking-at ".*//.*swift-mode:test:known-bug"))
+ (status 'ok))
(delete-horizontal-space)
(when (= original-indent 0)
(indent-line-to 1))
@@ -108,6 +118,8 @@ ERROR-BUFFER is the buffer to output errors."
(indent-line-to original-indent)
(when (/= original-indent computed-indent)
+ (setq status (if known-bug 'warning 'error))
+
(swift-mode:show-error
error-buffer swift-file current-line
(if known-bug "warning" "error")
@@ -119,12 +131,13 @@ ERROR-BUFFER is the buffer to output errors."
(prin1-to-string computed-indent))))
(when (and (= original-indent computed-indent) known-bug)
+ (setq status 'info)
(swift-mode:show-error
error-buffer swift-file current-line
"info"
"known-bug is fixed somehow"))
- (= original-indent computed-indent)))
+ status))
(defun swift-mode:show-error (error-buffer file line level message)
"Show an error message to the ERROR-BUFFER or stdout.
- [nongnu] elpa/swift-mode 37cab39 263/496: Improve indentation for switch and class statements, (continued)
- [nongnu] elpa/swift-mode 37cab39 263/496: Improve indentation for switch and class statements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cb7ba6f 245/496: Add an option for indent after hanging comma, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0185315 274/496: Merge pull request #107 from uk-ar/fix-forward-list, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 27ec163 286/496: Merge pull request #113 from uk-ar/add-keyword-for-attribute, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f43317e 290/496: Add MELPA badge in README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c73ce40 301/496: Update README.md about swift3-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7fc03bf 295/496: Merge pull request #119 from syohex/update-url, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 73abb98 292/496: Use cl-lib function instead of cl.el one, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 787658f 305/496: Update CONTRIBUTING.md, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0e24233 307/496: Fix forward/backward-sexp inside comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 60dab9b 308/496: Update test to return informative exit status,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 01a1127 318/496: Fix indentation before "where", ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b135df3 316/496: Fix output messages of the test, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7837c90 319/496: Fix indentation around "where" and "catch", ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 42a209c 322/496: Fix indentation of guard, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ab9f414 320/496: Fix indentation of close curly brace of switch, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 97d86cd 326/496: Tweak test runner, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ea77cf9 328/496: Add comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 6cd2948 342/496: Bump version to 2.2.1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7e78225 336/496: Bump version to 2.2, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1868590 348/496: Add build/debug command, ELPA Syncer, 2021/08/29