Skip to content
Snippets Groups Projects
Commit 40310b30 authored by pfdietz's avatar pfdietz
Browse files

Added rt::*expected-failures*, which should contain a list of the names of...

Added rt::*expected-failures*, which should contain a list of the names of tests that are expected to fail.  If this variable is not nil, the report after (rt:do-tests) will also print how many unexpected failures occured and their names.
parent a4df9b2d
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
them.") them.")
(defvar *optimization-settings* '((safety 3))) (defvar *optimization-settings* '((safety 3)))
(defvar *expected-failures* nil
"A list of test names that are expected to fail.")
(defstruct (entry (:conc-name nil) (defstruct (entry (:conc-name nil)
(:type list)) (:type list))
pend name form) pend name form)
...@@ -225,14 +228,31 @@ them.") ...@@ -225,14 +228,31 @@ them.")
(when (pend entry) (when (pend entry)
(format s "~@[~<~%~:; ~:@(~S~)~>~]" (format s "~@[~<~%~:; ~:@(~S~)~>~]"
(do-entry entry s)))) (do-entry entry s))))
(let ((pending (pending-tests))) (let ((pending (pending-tests))
(if (null pending) (expected-table (make-hash-table :test #'equal)))
(format s "~&No tests failed.") (dolist (ex *expected-failures*)
(format s "~&~A out of ~A ~ (setf (gethash ex expected-table) t))
(let ((new-failures
(loop for pend in pending
unless (gethash pend expected-table)
collect pend)))
(if (null pending)
(format s "~&No tests failed.")
(progn
(format s "~&~A out of ~A ~
total tests failed: ~ total tests failed: ~
~:@(~{~<~% ~1:;~S~>~ ~:@(~{~<~% ~1:;~S~>~
~^, ~}~)." ~^, ~}~)."
(length pending) (length pending)
(length (cdr *entries*)) (length (cdr *entries*))
pending)) pending)
(null pending))) (if (null new-failures)
(format s "~&No unexpected failures.")
(when *expected-failures*
(format s "~&~A unexpected failures: ~
~:@(~{~<~% ~1:;~S~>~
~^, ~}~)."
(length new-failures)
new-failures)))
))
(null pending))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment