From 54e71be7b54189f8a99d083abd8809f5627a26ce Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 9 Oct 2019 13:11:54 +0530 Subject: tests: Log test results to stderr. * build-aux/test-driver.scm.in (my-gnu-runner): Log colorized test results to stderr. --- build-aux/test-driver.scm.in | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build-aux/test-driver.scm.in b/build-aux/test-driver.scm.in index 89b9b68..96d84e0 100644 --- a/build-aux/test-driver.scm.in +++ b/build-aux/test-driver.scm.in @@ -17,7 +17,8 @@ ;;; License along with guile-email. If not, see ;;; . -(use-modules (ice-9 getopt-long) +(use-modules (ice-9 format) + (ice-9 getopt-long) (srfi srfi-26) (srfi srfi-64)) @@ -44,11 +45,14 @@ (test-runner-on-group-end! runner (const #f)) (test-runner-on-test-end! runner (lambda (runner) - (format trs-port ":test-result: ~A ~A~%" - (string-upcase - (symbol->string - (test-result-kind runner))) - (test-runner-test-name runner)))) + (let ((name (test-runner-test-name runner)) + (result (string-upcase + (symbol->string (test-result-kind runner))))) + (format trs-port ":test-result: ~a ~a~%" result name) + (format (current-error-port) + "\x1b[~:[31~;32~]m~a\x1b[0m ~a~%" + (eq? (test-result-kind runner) 'pass) + result name)))) runner)) (let ((opts (getopt-long (command-line) %options))) -- cgit v1.2.3