r7rs-test: print all failed tests in the end
This commit is contained in:
parent
d85801e396
commit
64d757d46a
|
@ -47,6 +47,8 @@
|
|||
(define counter 0)
|
||||
(define failure-counter 0)
|
||||
|
||||
(define fails '())
|
||||
|
||||
(define (print-statistics)
|
||||
(newline)
|
||||
(display "[0;34mTest Result: ")
|
||||
|
@ -58,7 +60,11 @@
|
|||
(display "%)")
|
||||
(display " [PASS/TOTAL]")
|
||||
(display "[0;39m")
|
||||
(newline))
|
||||
(newline)
|
||||
(for-each
|
||||
(lambda (fail)
|
||||
(display fail))
|
||||
fails))
|
||||
|
||||
(define (test-begin . o)
|
||||
(set! test-counter (+ test-counter 1)))
|
||||
|
@ -85,15 +91,19 @@
|
|||
)
|
||||
((not (equal? res expected))
|
||||
(set! failure-counter (+ failure-counter 1))
|
||||
(display " [0;31mFAIL: ")
|
||||
(write 'expr)
|
||||
(newline)
|
||||
(display " expected ")
|
||||
(write expected)
|
||||
(display " but got ")
|
||||
(write res)
|
||||
(display "[0;39m")
|
||||
(newline)))
|
||||
(let ((out (open-output-string)))
|
||||
(display " [0;31mFAIL: " out)
|
||||
(write 'expr out)
|
||||
(newline out)
|
||||
(display " expected " out)
|
||||
(write expected out)
|
||||
(display " but got " out)
|
||||
(write res out)
|
||||
(display "[0;39m" out)
|
||||
(newline out)
|
||||
(let ((str (get-output-string out)))
|
||||
(set! fails (cons str fails))
|
||||
(display str)))))
|
||||
(set! counter (+ counter 1))))))
|
||||
|
||||
(newline)
|
||||
|
|
Loading…
Reference in New Issue