Improve ctrf output. Update readme

This commit is contained in:
retropikzel 2026-01-20 18:52:29 +02:00
parent adf2cc5ac4
commit 5be5156551
2 changed files with 10 additions and 15 deletions

View File

@ -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)))

View File

@ -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.