Try to avoid `guile-test' failures when it can't display the name of a test.
authorLudovic Courtès <ludo@gnu.org>
Thu, 4 Mar 2010 10:32:51 +0000 (11:32 +0100)
committerLudovic Courtès <ludo@gnu.org>
Thu, 4 Mar 2010 10:32:51 +0000 (11:32 +0100)
This can happen, e.g., when printing "UNRESOLVED: regexp.test: TEST-NAME",
where TEST-NAME contains characters that cannot be converted to the
encoding of the current output or error port.

* test-suite/guile-test (main): Set the conversion strategy for the
  output and error ports to `escape'.

* test-suite/tests/regexp.test (current-output-port): Likewise.

test-suite/guile-test
test-suite/tests/regexp.test

index bb7797f..0031bbf 100755 (executable)
         ;; Allow for arbitrary Unicode characters in the log file.
         (set-port-encoding! log-port "UTF-8")
 
+        ;; Don't fail if we can't display a test name to stdout/stderr.
+        (set-port-conversion-strategy! (current-output-port) 'escape)
+        (set-port-conversion-strategy! (current-error-port) 'escape)
+
        ;; Register some reporters.
        (let ((global-pass #t)
              (counter (make-count-reporter)))
index bc785ab..a6844ca 100644 (file)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 regex))
 
-(set-port-conversion-strategy! (current-output-port) 'escape)
-
 (if (defined? 'setlocale)
     (setlocale LC_ALL "C"))
 
+;; Don't fail if we can't display a test name to stdout/stderr.
+(set-port-conversion-strategy! (current-output-port) 'escape)
+(set-port-conversion-strategy! (current-error-port) 'escape)
+
 \f
 ;;; Run a regexp-substitute or regexp-substitute/global test, once
 ;;; providing a real port and once providing #f, requesting direct