Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved ensure-cases macro to allow it to break on problems

Improved ensure-cases so that it takes *break-on-errors?* and
*break-on-failures?* into account. This makes debugging some
test problems much easier.
  • Loading branch information...
commit 16cc4e3834df22ee36b310f63f72e7e4f8bf1568 1 parent ee7851c
Gary King authored
Showing with 14 additions and 3 deletions.
  1. +14 −3 dev/macros.lisp
View
17 dev/macros.lisp
@@ -470,11 +470,21 @@ is generated instead of a warning"
(cancel-testing :interrupt)))
(error
(lambda (condition)
- (push (list ,case condition) ,errors)
- (go :continue))))
+ (let ((*in-middle-of-failure?* nil))
+ (push (list ,case condition) ,errors)
+ (when (and *test-break-on-errors?*
+ (not (test-case-expects-error-p
+ *current-testsuite-name* *current-test-case-name*)))
+ (invoke-debugger condition))
+ (go :continue)))))
(progn ,@body))
(ensure-failed (cond)
- (push (list ,case cond) ,problems))))
+ (push (list ,case cond) ,problems)
+ (when (and *test-break-on-failures?*
+ (not (test-case-expects-failure-p
+ *current-testsuite-name* *current-test-case-name*)))
+ (let ((*in-middle-of-failure?* nil))
+ (invoke-debugger cond))))))
:continue))
(if (or ,problems ,errors)
(let ((condition (make-condition
@@ -488,6 +498,7 @@ is generated instead of a warning"
;; return true if we're happy
t))))
+
#+(or)
(defmacro ensure-member
(form values &key (test nil test-specified-p)

0 comments on commit 16cc4e3

Please sign in to comment.
Something went wrong with that request. Please try again.