[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 8c486e6 067/340: Move print settings to the batc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 8c486e6 067/340: Move print settings to the batch reporter where they belong. |
Date: |
Thu, 16 Dec 2021 14:59:05 -0500 (EST) |
branch: elpa/buttercup
commit 8c486e68f001ea066cf70b38e182f9c9deaf653b
Author: Jorgen Schaefer <contact@jorgenschaefer.de>
Commit: Jorgen Schaefer <contact@jorgenschaefer.de>
Move print settings to the batch reporter where they belong.
---
buttercup.el | 139 ++++++++++++++++++++++++++++++-----------------------------
1 file changed, 70 insertions(+), 69 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 4bfc769..402c886 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -632,8 +632,7 @@ current directory."
(defun buttercup-run ()
(if buttercup-suites
- (let ((print-escape-newlines t)
- (print-escape-nonascii t))
+ (progn
(funcall buttercup-reporter 'buttercup-started buttercup-suites)
(mapc #'buttercup--run-suite buttercup-suites)
(funcall buttercup-reporter 'buttercup-done buttercup-suites))
@@ -727,74 +726,76 @@ Calls either `buttercup-reporter-batch' or
"List of failed specs of the current batch report.")
(defun buttercup-reporter-batch (event arg)
- (pcase event
- (`buttercup-started
- (setq buttercup-reporter-batch--start-time (float-time))
- (buttercup--print "Running %s specs.\n\n"
- (buttercup-suites-total-specs-defined arg)))
-
- (`suite-started
- (let ((level (length (buttercup-suite-parents arg))))
- (buttercup--print "%s%s\n"
- (make-string (* 2 level) ?\s)
- (buttercup-suite-description arg))))
-
- (`spec-started
- (let ((level (length (buttercup-spec-parents arg))))
- (buttercup--print "%s%s"
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description arg))))
-
- (`spec-done
- (cond
- ((eq (buttercup-spec-status arg) 'passed)
- (buttercup--print "\n"))
- ((eq (buttercup-spec-status arg) 'failed)
- (buttercup--print " FAILED\n")
- (setq buttercup-reporter-batch--failures
- (append buttercup-reporter-batch--failures
- (list arg))))
- (t
- (error "Unknown spec status %s" (buttercup-spec-status arg)))))
-
- (`suite-done
- (when (= 0 (length (buttercup-suite-parents arg)))
- (buttercup--print "\n")))
-
- (`buttercup-done
- (dolist (failed buttercup-reporter-batch--failures)
- (let ((description (buttercup-spec-failure-description failed))
- (stack (buttercup-spec-failure-stack failed)))
- (buttercup--print "%s\n" (make-string 40 ?=))
- (buttercup--print "%s\n" (buttercup-spec-full-name failed))
- (when stack
- (buttercup--print "\nTraceback (most recent call last):\n")
- (dolist (frame stack)
- (let ((line (format " %S" (cdr frame))))
- (when (> (length line) 79)
- (setq line (concat (substring line 0 76)
- "...")))
- (buttercup--print "%s\n" line))))
- (cond
- ((stringp description)
- (buttercup--print "FAILED: %s\n" description))
- ((eq (car description) 'error)
- (buttercup--print "%S: %S\n\n"
- (car description)
- (cadr description)))
- (t
- (buttercup--print "FAILED: %S\n" description)))
+ (let ((print-escape-newlines t)
+ (print-escape-nonascii t))
+ (pcase event
+ (`buttercup-started
+ (setq buttercup-reporter-batch--start-time (float-time))
+ (buttercup--print "Running %s specs.\n\n"
+ (buttercup-suites-total-specs-defined arg)))
+
+ (`suite-started
+ (let ((level (length (buttercup-suite-parents arg))))
+ (buttercup--print "%s%s\n"
+ (make-string (* 2 level) ?\s)
+ (buttercup-suite-description arg))))
+
+ (`spec-started
+ (let ((level (length (buttercup-spec-parents arg))))
+ (buttercup--print "%s%s"
+ (make-string (* 2 level) ?\s)
+ (buttercup-spec-description arg))))
+
+ (`spec-done
+ (cond
+ ((eq (buttercup-spec-status arg) 'passed)
+ (buttercup--print "\n"))
+ ((eq (buttercup-spec-status arg) 'failed)
+ (buttercup--print " FAILED\n")
+ (setq buttercup-reporter-batch--failures
+ (append buttercup-reporter-batch--failures
+ (list arg))))
+ (t
+ (error "Unknown spec status %s" (buttercup-spec-status arg)))))
+
+ (`suite-done
+ (when (= 0 (length (buttercup-suite-parents arg)))
(buttercup--print "\n")))
- (buttercup--print "Ran %s specs, %s failed, in %.1f seconds.\n"
- (buttercup-suites-total-specs-defined arg)
- (buttercup-suites-total-specs-failed arg)
- (- (float-time)
- buttercup-reporter-batch--start-time))
- (when (> (buttercup-suites-total-specs-failed arg) 0)
- (error "")))
-
- (t
- (error "Unknown event %s" event))))
+
+ (`buttercup-done
+ (dolist (failed buttercup-reporter-batch--failures)
+ (let ((description (buttercup-spec-failure-description failed))
+ (stack (buttercup-spec-failure-stack failed)))
+ (buttercup--print "%s\n" (make-string 40 ?=))
+ (buttercup--print "%s\n" (buttercup-spec-full-name failed))
+ (when stack
+ (buttercup--print "\nTraceback (most recent call last):\n")
+ (dolist (frame stack)
+ (let ((line (format " %S" (cdr frame))))
+ (when (> (length line) 79)
+ (setq line (concat (substring line 0 76)
+ "...")))
+ (buttercup--print "%s\n" line))))
+ (cond
+ ((stringp description)
+ (buttercup--print "FAILED: %s\n" description))
+ ((eq (car description) 'error)
+ (buttercup--print "%S: %S\n\n"
+ (car description)
+ (cadr description)))
+ (t
+ (buttercup--print "FAILED: %S\n" description)))
+ (buttercup--print "\n")))
+ (buttercup--print "Ran %s specs, %s failed, in %.1f seconds.\n"
+ (buttercup-suites-total-specs-defined arg)
+ (buttercup-suites-total-specs-failed arg)
+ (- (float-time)
+ buttercup-reporter-batch--start-time))
+ (when (> (buttercup-suites-total-specs-failed arg) 0)
+ (error "")))
+
+ (t
+ (error "Unknown event %s" event)))))
(defun buttercup--print (fmt &rest args)
(send-string-to-terminal (apply #'format fmt args)))
- [nongnu] elpa/buttercup 3deb9a4 053/340: Test discovery: Ignore files in dot directories., (continued)
- [nongnu] elpa/buttercup 3deb9a4 053/340: Test discovery: Ignore files in dot directories., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 444716b 079/340: Handle windows better in interactive runs., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 512b82b 077/340: Rework documentation to make the readme more concise., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 238bfa8 082/340: Support --pattern command line argument, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5cbd468 084/340: Bump version: 1.2 → 1.3, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ba8cd05 106/340: Merge pull request #59 from immerrr/add-other-emacs-params, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 07c525e 116/340: Merge pull request #68 from ebpa/report-load-errors, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 11f072f 123/340: Merge pull request #81 from DamienCassou/fix-to-have-same-items-as, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 562cdb0 058/340: The buttercup-suite-full-name function., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d264da3 075/340: Merge pull request #17 from Fuco1/master, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8c486e6 067/340: Move print settings to the batch reporter where they belong.,
ELPA Syncer <=
- [nongnu] elpa/buttercup 0f3eb63 078/340: Show actual function arguments when a spy fails., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 357e73b 085/340: Remove debug message, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 68692d9 113/340: Update Travis configuration instructions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 54696b0 124/340: Merge pull request #78 from Fuco1/feature/buttercup-minor-mode, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 77f0c74 122/340: Fix :to-have-same-items-as (fix #80), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 20ec520 145/340: Rename functions and arguments for closure manipulation, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5d1f338 146/340: Move let-binding outside loop for efficiency, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7fa79c4 048/340: Expand and improve the package commentary., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4f68f0b 059/340: The buttercup-spec-full-name function., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ef7b730 063/340: Various improvements of the batch reporter., ELPA Syncer, 2021/12/16