[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup c8f34ae3ed 05/16: Limit backtraces for spec exce
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup c8f34ae3ed 05/16: Limit backtraces for spec exceptions outside expect |
Date: |
Wed, 4 Sep 2024 18:59:24 -0400 (EDT) |
branch: elpa/buttercup
commit c8f34ae3edda96f1dab7b7d9e9ed2692c0ee7263
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
Limit backtraces for spec exceptions outside expect
The first uninteresting frame is identified by a new
`buttercup--stackframe-marker' in a let statement:
(let ((buttercup--stackframe-marker 1)) ...
This let-form is added to the buttercup-with-converted-ert-signals
macro, not because it has anything to do with ert signal conversion,
but because it is the last wrapper around the spec code given by the
user.
---
buttercup.el | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 7f30f2c38d..b1107a9df1 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2129,7 +2129,20 @@ ARGS according to `debugger'."
;; When the error occurs in the calling of one of the
;; wrapped expressions of an expect.
(buttercup--wrapper-fun-p (cadr frame))
- ;; TODO: error in `it' but outside `expect'
+ ;; When an error happens in spec code but outside an expect
+ ;; statement
+ ;; buttercup--update-with-funcall
+ ;; apply buttercup--funcall
+ ;; buttercup--funcall - sets debugger
+ ;; apply FUNCTION
+ ;; FUNCTION -- spec body function
+ ;; condition-case -- from
buttercup-with-converted-ert-signals
+ ;; (let ((buttercup--stackframe-marker 1)) -- the same
+ ;; ACTUAL CODE
+ (and (null (car frame))
+ (eq 'let (cadr frame))
+ (equal '((buttercup--stackframe-marker 1)) (car (cddr frame)))
+ )
;; TODO: What about an error in a matcher?
;; TODO: What about :to-throw?
;; TODO: What about signals in before and after blocks?
@@ -2184,7 +2197,9 @@ Specifically, `ert-test-failed' is converted to
`buttercup-pending'."
(declare (indent 0))
`(condition-case err
- (progn ,@body)
+ (let ((buttercup--stackframe-marker 1))
+ (ignore buttercup--stackframe-marker)
+ ,@body)
(ert-test-failed
(buttercup-fail "%S" err))
(ert-test-skipped
- [nongnu] elpa/buttercup updated (dfbef21772 -> 8408579758), ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 45d53515da 02/16: Stop adding frames to backtrace once a buttercup wrap func is found, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 0444816a60 07/16: tests: Refactor test that no backtraces are collected for skipped specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup ee000fabd1 04/16: tests: Cleanup and comments, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 0552fe4d5b 12/16: Add :to-be-close-to docstring, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup c8f34ae3ed 05/16: Limit backtraces for spec exceptions outside expect,
ELPA Syncer <=
- [nongnu] elpa/buttercup add32f8cbf 08/16: Collect stacktraces for errors in matchers, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup be72aa872c 06/16: tests: Verify that backtraces are not collected for passed specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 8408579758 16/16: Rewrite buttercup-expect with pcase, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 925af155be 15/16: tests: Add backtrace tests for function matchers, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup df7f98e110 03/16: Do not collect backtraces for failed specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 4b1682ec98 01/16: Use the base argument of backtrace-frame, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup a1d0d73999 11/16: Improve docstring of buttercup-define-matcher, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 789570cf7d 10/16: Merge pull request #249 from snogge/fix-247, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup f577efc524 09/16: Remove remaining uses of `buttercup--mark-stackframe', ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 9bb00a269d 13/16: Improve the docstring of the expect macro, ELPA Syncer, 2024/09/04