[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup b410c78 193/340: Separate return code from repor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup b410c78 193/340: Separate return code from reporter |
Date: |
Thu, 16 Dec 2021 14:59:32 -0500 (EST) |
branch: elpa/buttercup
commit b410c7835bd043a17c774408a07ec108bec0b6d4
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>
Separate return code from reporter
The reporter should not contain anything that affects the running of
the tests. Setting buttercup-reporter to 'ignore should just produce
no output. It shall be possible to chain two reporters without
exiting when the first reporter reaches buttercup-done.
---
buttercup.el | 12 +++++-------
tests/test-buttercup.el | 8 ++++++--
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 523521c..63864bb 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1350,7 +1350,9 @@ A suite must be defined within a Markdown \"lisp\" code
block."
(progn
(funcall buttercup-reporter 'buttercup-started buttercup-suites)
(mapc #'buttercup--run-suite buttercup-suites)
- (funcall buttercup-reporter 'buttercup-done buttercup-suites))
+ (funcall buttercup-reporter 'buttercup-done buttercup-suites)
+ (when (> (buttercup-suites-total-specs-failed buttercup-suites) 0)
+ (error "")))
(error "No suites defined")))
(defvar buttercup--before-each nil
@@ -1542,9 +1544,7 @@ EVENT and ARG are described in `buttercup-reporter'."
(buttercup--print "Ran %s specs, %s failed, in %.1f seconds.\n"
defined
failed
- duration))
- (when (> failed 0)
- (error ""))))
+ duration))))
(_
(error "Unknown event %s" event)))))
@@ -1628,9 +1628,7 @@ EVENT and ARG are described in `buttercup-reporter'."
", in %.1f seconds.\n")
defined
failed
- duration))
- (when (> failed 0)
- (error ""))))
+ duration))))
(_
;; Fall through to buttercup-reporter-batch implementation.
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 40aeee9..20324c4 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -979,11 +979,11 @@
(it "should handle the end event"
(buttercup-reporter-batch 'buttercup-done nil))
- (it "should raise an error if at least one spec failed"
+ (it "should not raise any error even if a spec failed"
(setf (buttercup-spec-status spec) 'failed)
(expect (buttercup-reporter-batch 'buttercup-done (list spec))
- :to-throw)))
+ :not :to-throw)))
(describe "on an unknown event"
(it "should raise an error"
@@ -1006,6 +1006,10 @@
(buttercup-suite-add-child child-suite spec)
(spy-on 'reporter)
(spy-on 'runner))
+ (it "should raise an error if at least one spec failed"
+ (setf (buttercup-spec-status spec) 'failed)
+ (cl-letf (((symbol-function 'buttercup--run-suite) #'ignore))
+ (expect (buttercup-run) :to-throw)))
(it "should call the reporter twice with events buttercup-started and
-done"
(cl-letf (((symbol-function 'buttercup--run-suite) #'ignore))
(expect (buttercup-run) :not :to-throw)
- [nongnu] elpa/buttercup bbbf692 166/340: Fix more compile warnings., (continued)
- [nongnu] elpa/buttercup bbbf692 166/340: Fix more compile warnings., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bcaa7f0 163/340: Use buttercup--specs where possible, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 61ebe91 171/340: Update README.md, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 39d625c 173/340: Bump version: 1.11 → 1.12, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6330610 176/340: Add more markdown running functions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 3d3aff9 178/340: Set file local code-style variables in test-buttercup.el, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 553529f 181/340: Remove obsolete buttercup-xdescribe, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5821cd0 184/340: Merge pull request #131 from snogge/markdown, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a394fea 191/340: Bump version: 1.13 → 1.14, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7cea4c6 192/340: Test buttercup-run, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b410c78 193/340: Separate return code from reporter,
ELPA Syncer <=
- [nongnu] elpa/buttercup 9b230dc 202/340: Fix the "should print the elapsed time for all specs" test, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9d172a7 205/340: Merge pull request #145 from snogge/test-fixes, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c100fad 210/340: Implement buttercup-suppress-warning-capture, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c994aea 212/340: Add LICENSE file., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d9ce620 213/340: Merge branch 'license-file' into master, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 49f01fc 219/340: Merge branch 'master' into test-emacs-26.3, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 25462dd 223/340: Record calls to spied-on functions that throw errors, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bf48137 224/340: Add some tests for error-call recording, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup fc19598 225/340: Add examples for checking return value and thrown signal of a spy, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6590360 226/340: Fix a few typos and other small errors, ELPA Syncer, 2021/12/16