Don't annoy the user with test-engine summaries.

Make sure the test-engine summary is only printed when there's
something new to say.
This commit is contained in:
Mike Sperber 2010-10-18 10:10:27 +02:00
parent 0821f694af
commit 43d097cc05

View File

@ -126,6 +126,7 @@
(define display-rep #f) (define display-rep #f)
(define display-event-space #f) (define display-event-space #f)
(define silent-mode #t) (define silent-mode #t)
(define test-run-since-last-display? #f)
(super-instantiate ()) (super-instantiate ())
@ -172,11 +173,13 @@
[(mixed-results) [(mixed-results)
(display-results display-rep display-event-space)])))) (display-results display-rep display-event-space)]))))
(else (else
(display-disabled port)))) (display-disabled port)))
(set! test-run-since-last-display? #f))
(define/private (display-success port event-space count) (define/private (display-success port event-space count)
(clear-results event-space) (when test-run-since-last-display?
(send test-display display-success-summary port count)) (clear-results event-space)
(send test-display display-success-summary port count)))
(define/public (display-results rep event-space) (define/public (display-results rep event-space)
(cond (cond
@ -190,16 +193,19 @@
[else (send test-display display-results)])) [else (send test-display display-results)]))
(define/public (display-untested port) (define/public (display-untested port)
(unless silent-mode (when (and test-run-since-last-display?
(send test-display display-untested-summary port))) (not silent-mode))
(send test-display display-untested-summary port)))
(define/public (display-disabled port) (define/public (display-disabled port)
(send test-display display-disabled-summary port)) (when test-run-since-last-display?
(send test-display display-disabled-summary port)))
(define/pubment (initialize-test test) (define/pubment (initialize-test test)
(inner (void) initialize-test test)) (inner (void) initialize-test test))
(define/pubment (run-test test) (define/pubment (run-test test)
(set! test-run-since-last-display? #t)
(inner (void) run-test test)) (inner (void) run-test test))
(define/pubment (run-testcase testcase) (define/pubment (run-testcase testcase)