From 48f360674a79b7eca47998675c6de02263329c36 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 27 Jan 2017 12:58:56 -0800 Subject: [PATCH] Summarize test results at end of run. --- tests/check.scm | 83 +++++++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 33 deletions(-) diff --git a/tests/check.scm b/tests/check.scm index 2595ff50f..2518aa98e 100644 --- a/tests/check.scm +++ b/tests/check.scm @@ -78,36 +78,53 @@ USA. (directory-pathname (current-load-pathname)) (lambda () (load "load") - (for-each (lambda (entry) - (receive (pathname environment) - (if (pair? entry) - (values (car entry) (->environment (cadr entry))) - (values entry #!default)) - (with-notification - (lambda (output-port) - (write-string "Running tests in " output-port) - (write pathname output-port) - (if (not (default-object? environment)) - (begin - (write-string " in environment " output-port) - (write (cond ((environment->package environment) - => package/name) - (else environment)) - output-port)))) - (lambda () - (if (not (pathname-type pathname)) - (with-working-directory-pathname - (directory-pathname pathname) - (lambda () - ;++ Kludge around a bug in SF... - (compile-file (file-pathname pathname) - '() - environment)))) - (let* ((t (pathname-type pathname)) - (p (if (and t (string=? "com" t) - (eq? 'C - microcode-id/compiled-code-type)) - (pathname-new-type pathname "so") - pathname))) - (run-unit-tests p environment)))))) - known-tests))) \ No newline at end of file + (let ((results + (map (lambda (entry) + (receive (pathname environment) + (if (pair? entry) + (values (car entry) (->environment (cadr entry))) + (values entry #!default)) + (with-notification + (lambda (output-port) + (write-string "Running tests in " output-port) + (write pathname output-port) + (if (not (default-object? environment)) + (begin + (write-string " in environment " output-port) + (write (cond ((environment->package environment) + => package/name) + (else environment)) + output-port)))) + (lambda () + (if (not (pathname-type pathname)) + (with-working-directory-pathname + (directory-pathname pathname) + (lambda () + ;++ Kludge around a bug in SF... + (compile-file (file-pathname pathname) + '() + environment)))) + (let* ((t (pathname-type pathname)) + (p (if (and t (string=? "com" t) + (eq? 'C + microcode-id/compiled-code-type)) + (pathname-new-type pathname "so") + pathname))) + (cons pathname + (run-unit-tests p environment))))))) + known-tests))) + + (define (show-results results) + (for-each (lambda (p) + (write-string (if (cdr p) "PASSED" "FAILED")) + (write-string ": ") + (write (car p)) + (newline)) + results)) + + (fresh-line) + (newline) + (write-string "Test results:") + (newline) + (show-results (filter cdr results)) + (show-results (remove cdr results))))) \ No newline at end of file -- 2.25.1