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) (lambda (any)
(let ((port (open-output-string))) (let ((port (open-output-string)))
(display any port) (display any port)
(newline) (newline port)
(get-output-string port)))) (get-output-string port))))
(runner (test-runner-null)) (runner (test-runner-null))
(tests (vector)) (tests (vector))
@ -105,22 +105,16 @@
(output-file (string-append implementation-name (output-file (string-append implementation-name
"-" "-"
first-group-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)) (when (file-exists? output-file) (delete-file output-file))
(with-output-to-file (with-output-to-file
output-file output-file
(lambda () (lambda ()
(json-write output (current-output-port)))) (json-write output (current-output-port))))
(when (not (= (vector-length failed-tests) 0)) (json-write short-output (current-output-port))
(display "[") (newline (current-output-port))
(newline)
(vector-for-each
(lambda (failed-test)
(display " ")
(json-write failed-test)
(newline))
failed-tests)
(display "]")
(newline))
(exit (+ fail xfail))))) (exit (+ fail xfail)))))
runner))) runner)))

View File

@ -13,8 +13,9 @@ Usage:
(test-runner-current (ctrf-runner)) (test-runner-current (ctrf-runner))
Then run tests as usual. The CTRF output will be outputted into JSON file Then run tests as usual. The full CTRF output will be outputted into JSON file
named as ${SCHEME}-${FIRST\_TEST\_GROUP\_NAME}.ctrf.json. 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 Any failing tests and summary will be printed into stdout as list of JSON
objects. objects.