From e4319c3ef9f5785e7c9f8f026c445ce64a19b0ef Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 29 Apr 2024 22:06:06 +0800 Subject: [PATCH] [srfi64-extras] don't customise srfi64 test-runner it was causing more trouble than it's worth --- bindings/guile/test/srfi64-extras.scm | 37 ++++++++------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/bindings/guile/test/srfi64-extras.scm b/bindings/guile/test/srfi64-extras.scm index b41baee4322..ecdd558ddfe 100644 --- a/bindings/guile/test/srfi64-extras.scm +++ b/bindings/guile/test/srfi64-extras.scm @@ -21,29 +21,14 @@ (use-modules (srfi srfi-64)) (export gnc:test-runner) -(define (gnc:test-runner) - (let ((runner (test-runner-null)) - (num-passed 0) - (num-failed 0)) - (test-runner-on-test-end! runner - (lambda (runner) - (format #t "[~a] line:~a, test: ~a\n" - (test-result-ref runner 'result-kind) - (test-result-ref runner 'source-line) - (test-runner-test-name runner)) - (case (test-result-kind runner) - ((pass xpass) (set! num-passed (1+ num-passed))) - ((fail xfail) - (if (test-result-ref runner 'expected-value) - (format #t "~a\n -> expected: ~s\n -> obtained: ~s\n" - (string-join (test-runner-group-path runner) "/") - (test-result-ref runner 'expected-value) - (test-result-ref runner 'actual-value))) - (set! num-failed (1+ num-failed))) - (else #t)))) - (test-runner-on-final! runner - (lambda (runner) - (format #t "Source:~a\npass = ~a, fail = ~a\n" - (test-result-ref runner 'source-file) num-passed num-failed) - (zero? num-failed))) - runner)) +(define gnc:test-runner test-runner-simple) + +;; note this file contained a customisation for the srfi-64 +;; test-runner, logging all passing and failing tests, and calling +;; (exit num-failed-tests) which would then be reported by "ninja +;; check" as a test failure. Unfortunately the guile coverage test +;; required removing the premature exit with exitlevel, therefore +;; ninja wouldn't be capable of detecting test failures anymore. This +;; is now a stub module to use the default test-runner-simple as +;; provided in srfi-64, which returns non-zero exitlevel on test +;; failures.