aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-07-27 15:03:13 +0530
committerArun Isaac2021-07-27 15:03:13 +0530
commit7882038037b7b0911b63f3dd2a4413f5668c37da (patch)
treed491b38de8254bbcd131f370df9500bf75cf18db
parentdc5273cbb260e03f181e5c3158c4cdc4d483f599 (diff)
downloadccwl-7882038037b7b0911b63f3dd2a4413f5668c37da.tar.gz
ccwl-7882038037b7b0911b63f3dd2a4413f5668c37da.tar.lz
ccwl-7882038037b7b0911b63f3dd2a4413f5668c37da.zip
build-aux: Use #t as the expected value for test-assert tests.
* build-aux/test-driver.scm.in: Import (ice-9 match). (my-gnu-runner): Use #t as the expected value for test-assert tests.
-rw-r--r--build-aux/test-driver.scm.in16
1 files changed, 10 insertions, 6 deletions
diff --git a/build-aux/test-driver.scm.in b/build-aux/test-driver.scm.in
index f417ca3..1407fc8 100644
--- a/build-aux/test-driver.scm.in
+++ b/build-aux/test-driver.scm.in
@@ -27,6 +27,7 @@
(use-modules (ice-9 format)
(ice-9 getopt-long)
+ (ice-9 match)
(srfi srfi-26)
(srfi srfi-64))
@@ -72,12 +73,15 @@
(format log-port "~a ~a~%" result name)
;; If test did not pass, print details.
(unless (eq? (test-result-kind runner) 'pass)
- (let ((log-output
- (format #f "~a:~a~%expected: ~s~%actual: ~s~%"
- (assq-ref result-alist 'source-file)
- (assq-ref result-alist 'source-line)
- (assq-ref result-alist 'expected-value)
- (assq-ref result-alist 'actual-value))))
+ (let* ((expected-value (match (assq-ref result-alist 'source-form)
+ (('test-assert _ ...) #t)
+ (_ (assq-ref result-alist 'expected-value))))
+ (log-output
+ (format #f "~a:~a~%expected: ~s~%actual: ~s~%"
+ (assq-ref result-alist 'source-file)
+ (assq-ref result-alist 'source-line)
+ expected-value
+ (assq-ref result-alist 'actual-value))))
(display log-output log-port)
(display log-output (current-error-port)))))))
runner))