From 5be515655192cf7c76711dcf43bb5e2179d2aacd Mon Sep 17 00:00:00 2001 From: retropikzel Date: Tue, 20 Jan 2026 18:52:29 +0200 Subject: [PATCH] Improve ctrf output. Update readme --- retropikzel/ctrf.scm | 20 +++++++------------- retropikzel/ctrf/README.md | 5 +++-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/retropikzel/ctrf.scm b/retropikzel/ctrf.scm index 866c9e1..23de602 100644 --- a/retropikzel/ctrf.scm +++ b/retropikzel/ctrf.scm @@ -4,7 +4,7 @@ (lambda (any) (let ((port (open-output-string))) (display any port) - (newline) + (newline port) (get-output-string port)))) (runner (test-runner-null)) (tests (vector)) @@ -105,22 +105,16 @@ (output-file (string-append implementation-name "-" first-group-name - ".ctrf.json"))) + ".ctrf.json")) + (short-output `((scheme . ,implementation-name) + (summary . ,summary) + (full . ,output-file)))) (when (file-exists? output-file) (delete-file output-file)) (with-output-to-file output-file (lambda () (json-write output (current-output-port)))) - (when (not (= (vector-length failed-tests) 0)) - (display "[") - (newline) - (vector-for-each - (lambda (failed-test) - (display " ") - (json-write failed-test) - (newline)) - failed-tests) - (display "]") - (newline)) + (json-write short-output (current-output-port)) + (newline (current-output-port)) (exit (+ fail xfail))))) runner))) diff --git a/retropikzel/ctrf/README.md b/retropikzel/ctrf/README.md index db350c6..14e5193 100644 --- a/retropikzel/ctrf/README.md +++ b/retropikzel/ctrf/README.md @@ -13,8 +13,9 @@ Usage: (test-runner-current (ctrf-runner)) -Then run tests as usual. The CTRF output will be outputted into JSON file -named as ${SCHEME}-${FIRST\_TEST\_GROUP\_NAME}.ctrf.json. +Then run tests as usual. The full CTRF output will be outputted into JSON file +named as ${SCHEME}-${FIRST\_TEST\_GROUP\_NAME}.ctrf.json. And short summary +will be outputted into (current-output-port). Any failing tests and summary will be printed into stdout as list of JSON objects.