Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions runner.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#:getenv)
(:import-from #:ace.core.macro
#:eval-always)
(:import-from #:ace.core.hook
#:define-hook-function)
(:import-from #:ace.core.check.condition
#:failed
#:missed
Expand All @@ -37,7 +35,7 @@
#:make-schedule
#:nothing-tested
#:run-tests
#:report-tests
#:*reporting-hooks*
#:run-and-report-tests
#:deregister-tests
#:*debug-unit-tests*
Expand Down Expand Up @@ -538,12 +536,12 @@ If PARALLEL is NIL, the PARALLEL tests will be empty."))
all-count check-count failed-count))
(zerop failed-count))))

(define-hook-function report-tests (tests &key out)
:documentation
"Called to report the TESTS from RUN-AND-REPORT-TESTS. The TESTS is a list of TEST-RUN objects.
OUT specifies the default output stream to which the report is printed.")

(defmethod report-tests print-summary-and-failures (tests &key (out *error-output*))
(defvar *reporting-hooks* nil "User-specified final report functions")
(defun report-tests (tests &key (out *error-output*))
(dolist (hook *reporting-hooks*)
(handler-case (funcall hook tests :out out)
(:no-error (&rest vals) (values-list vals))
(error (e) (format t "Caught [~A] while trying to run reporting hook" e))))
(let ((fail-count (count-if #'test-run-error tests))
(all-count (length tests))
(checks-count (loop for test-run in tests sum (test-run-checks-count test-run))))
Expand Down
4 changes: 2 additions & 2 deletions xml-report.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#:function-file-path)
(:import-from #:ace.test.runner
#:with-sane-io-syntax
#:report-tests
#:test-run
#:test-run-test
#:test-run-error
Expand Down Expand Up @@ -178,7 +177,7 @@
(group-and-print-test-cases test-cases :key #'test-package-name :out out)
(format out "~&</testsuites>~%"))

(defmethod report-tests dump-junit-xml-output (test-cases &key &allow-other-keys)
(defun dump-junit-xml-output (test-cases &key &allow-other-keys)
(let ((xml-output (getenv "XML_OUTPUT_FILE")))
;; This variable is specified here:

Expand All @@ -192,3 +191,4 @@
:element-type 'character
:external-format :utf-8)
(print-tests-report test-cases out)))))
(pushnew 'dump-junit-xml-output ace.test.runner:*reporting-hooks*)
Loading