From 43d097cc05f25637abbd1a4f4dbc1f779c7aa778 Mon Sep 17 00:00:00 2001 From: Mike Sperber Date: Mon, 18 Oct 2010 10:10:27 +0200 Subject: [PATCH] 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. --- collects/test-engine/test-engine.rkt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/collects/test-engine/test-engine.rkt b/collects/test-engine/test-engine.rkt index 3cc7fba2a4..d8b25f2562 100644 --- a/collects/test-engine/test-engine.rkt +++ b/collects/test-engine/test-engine.rkt @@ -126,6 +126,7 @@ (define display-rep #f) (define display-event-space #f) (define silent-mode #t) + (define test-run-since-last-display? #f) (super-instantiate ()) @@ -172,11 +173,13 @@ [(mixed-results) (display-results display-rep display-event-space)])))) (else - (display-disabled port)))) + (display-disabled port))) + (set! test-run-since-last-display? #f)) (define/private (display-success port event-space count) - (clear-results event-space) - (send test-display display-success-summary port count)) + (when test-run-since-last-display? + (clear-results event-space) + (send test-display display-success-summary port count))) (define/public (display-results rep event-space) (cond @@ -190,16 +193,19 @@ [else (send test-display display-results)])) (define/public (display-untested port) - (unless silent-mode - (send test-display display-untested-summary port))) + (when (and test-run-since-last-display? + (not silent-mode)) + (send test-display display-untested-summary 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) (inner (void) initialize-test test)) (define/pubment (run-test test) + (set! test-run-since-last-display? #t) (inner (void) run-test test)) (define/pubment (run-testcase testcase)