[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 7903e1a 250/340: Revert "Make it possible to abo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 7903e1a 250/340: Revert "Make it possible to abort test run cleanly" |
Date: |
Thu, 16 Dec 2021 14:59:44 -0500 (EST) |
branch: elpa/buttercup
commit 7903e1ae21b8e80ed3a983c9e90dfbf4979e1fb3
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
Revert "Make it possible to abort test run cleanly"
Merged prematurely.
This reverts commit fc4276aabd8e2e7e2816192d1590b72c3a9e97d9.
---
buttercup.el | 66 ++++++++++++++++++++++--------------------------------------
1 file changed, 24 insertions(+), 42 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 2e7afa8..ef8cc5d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -117,14 +117,6 @@ a call to `save-match-data', as `format-spec' modifies
that."
(define-error 'buttercup-pending
"Buttercup test is pending")
-(define-error 'buttercup-abort
- "Abort Buttercup testing")
-
-(defvar buttercup-abort-message nil
- "The message explaining why Buttercup testing is aborted.
-Reporters may want to print it if non-nil when handling
-`buttercup-done' event.")
-
(defmacro expect (arg &optional matcher &rest args)
"Expect a condition to be true.
@@ -1430,15 +1422,12 @@ A suite must be defined within a Markdown \"lisp\" code
block."
(defun buttercup-run ()
"Run all described suites."
(if buttercup-suites
- (let (buttercup-abort-message)
+ (progn
(funcall buttercup-reporter 'buttercup-started buttercup-suites)
- (unwind-protect
- (condition-case error
- (mapc #'buttercup--run-suite buttercup-suites)
- (buttercup-abort (setf buttercup-abort-message (cdr error))))
- (funcall buttercup-reporter 'buttercup-done buttercup-suites)
- (when (> (buttercup-suites-total-specs-failed buttercup-suites) 0)
- (error ""))))
+ (mapc #'buttercup--run-suite 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
@@ -1459,20 +1448,18 @@ Do not change the global value.")
(buttercup--after-each (append (buttercup-suite-after-each suite)
buttercup--after-each)))
(funcall buttercup-reporter 'suite-started suite)
- (unwind-protect
- (progn
- (dolist (f (buttercup-suite-before-all suite))
- (buttercup--update-with-funcall suite f))
- (dolist (sub (buttercup-suite-children suite))
- (cond
- ((buttercup-suite-p sub)
- (buttercup--run-suite sub))
- ((buttercup-spec-p sub)
- (buttercup--run-spec sub))))
- (dolist (f (buttercup-suite-after-all suite))
- (buttercup--update-with-funcall suite f)))
- (buttercup--set-end-time suite)
- (funcall buttercup-reporter 'suite-done suite))))
+ (dolist (f (buttercup-suite-before-all suite))
+ (buttercup--update-with-funcall suite f))
+ (dolist (sub (buttercup-suite-children suite))
+ (cond
+ ((buttercup-suite-p sub)
+ (buttercup--run-suite sub))
+ ((buttercup-spec-p sub)
+ (buttercup--run-spec sub))))
+ (dolist (f (buttercup-suite-after-all suite))
+ (buttercup--update-with-funcall suite f))
+ (buttercup--set-end-time suite)
+ (funcall buttercup-reporter 'suite-done suite)))
(defun buttercup--run-spec (spec)
(buttercup--set-start-time spec)
@@ -1484,14 +1471,13 @@ Do not change the global value.")
(get-buffer-create buttercup-warning-buffer-name)
(funcall buttercup-reporter 'spec-started spec)
- (unwind-protect
- (buttercup-with-cleanup
- (dolist (f buttercup--before-each)
- (buttercup--update-with-funcall spec f))
- (buttercup--update-with-funcall spec (buttercup-spec-function
spec))
- (dolist (f buttercup--after-each)
- (buttercup--update-with-funcall spec f)))
- (funcall buttercup-reporter 'spec-done spec))
+ (buttercup-with-cleanup
+ (dolist (f buttercup--before-each)
+ (buttercup--update-with-funcall spec f))
+ (buttercup--update-with-funcall spec (buttercup-spec-function spec))
+ (dolist (f buttercup--after-each)
+ (buttercup--update-with-funcall spec f)))
+ (funcall buttercup-reporter 'spec-done spec)
;; Display warnings that were issued while running the the
;; spec, if any
(with-current-buffer buttercup-warning-buffer-name
@@ -1601,8 +1587,6 @@ EVENT and ARG are described in `buttercup-reporter'."
(dolist (failed buttercup-reporter-batch--failures)
(let ((description (buttercup-spec-failure-description failed))
(stack (buttercup-spec-failure-stack failed)))
- (when buttercup-abort-message
- (buttercup--print "%s\n" (if (stringp buttercup-abort-message)
buttercup-abort-message (prin1-to-string buttercup-abort-message))))
(buttercup--print "%s\n" (make-string 40 ?=))
(buttercup--print "%s\n" (buttercup-spec-full-name failed))
(when stack
@@ -1679,8 +1663,6 @@ EVENT and ARG are described in `buttercup-reporter'."
(dolist (failed buttercup-reporter-batch--failures)
(let ((description (buttercup-spec-failure-description failed))
(stack (buttercup-spec-failure-stack failed)))
- (when (stringp buttercup-abort-message)
- (buttercup--print "%s\n" (buttercup-colorize
buttercup-abort-message 'red)))
(buttercup--print "%s\n" (make-string 40 ?=))
(buttercup--print (buttercup-colorize "%s\n" 'red)
(buttercup-spec-full-name failed))
(when stack
- [nongnu] elpa/buttercup b298517 262/340: test: Mark some local function arguments as unused, (continued)
- [nongnu] elpa/buttercup b298517 262/340: test: Mark some local function arguments as unused, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8e29f4c 259/340: Extract buttercup--mark-skipped from buttercup-run-discover, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 669ca99 267/340: test: Split make rule test into test-buttercup and test-docs, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6655f77 269/340: Update test run duration output in buttercup-reporter-batch, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0e6c09e 271/340: Correct the assume docstring, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6848057 167/340: Bump version: 1.9 → 1.10, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8628d45 208/340: Merge pull request #147 from snogge/suite-local-function, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a6f2486 211/340: Merge pull request #150 from DarwinAwardWinner/suppress-warning-redirect, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a019f7a 221/340: Use spy-calls-count as appropriate, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b297b1d 241/340: Revert "Change: (buttercup-define-matcher-for-binary-function) Add newlines", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 7903e1a 250/340: Revert "Make it possible to abort test run cleanly",
ELPA Syncer <=
- [nongnu] elpa/buttercup 521b71b 253/340: Add tests to ensure pending spec state is not overwritten, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9265f83 258/340: Add test for buttercup-suites-total-specs-pending, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b360e35 264/340: test: Add tests for buttercup--mark-skipped, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9b94921 276/340: test: Add tests for buttercup-reporter-batch buttercup-done handling, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 2040757 277/340: test: Add reporter test for buttercup-started with pending specs, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a91f282 283/340: Handle multiline spec descriptions in buttercup-reporter-batch-color, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 532d082 284/340: test: Fix tab stops in send-string-to-ansi-buffer for Emacs 24.3, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8afc407 286/340: Switch from to pcase for spec-done in buttercup-reporter-batch-color, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d5c3ed5 289/340: Switch to Github Actions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 41424d5 292/340: Add new public function buttercup-mark-skipped, ELPA Syncer, 2021/12/16