| 1 |
#!r6rs |
| 2 |
;; Copyright 2009 Derick Eddington. My MIT-style license is in the file named |
| 3 |
;; LICENSE from the original collection this file is distributed with. |
| 4 |
|
| 5 |
(library (srfi :64 testing) |
| 6 |
(export |
| 7 |
test-begin |
| 8 |
test-end test-assert test-eqv test-eq test-equal |
| 9 |
test-approximate test-error test-apply test-with-runner |
| 10 |
test-match-nth test-match-all test-match-any test-match-name |
| 11 |
test-skip test-expect-fail test-read-eval-string |
| 12 |
test-group test-runner-group-path test-group-with-cleanup |
| 13 |
test-result-ref test-result-set! test-result-clear test-result-remove |
| 14 |
test-result-kind test-passed? |
| 15 |
(rename (%test-log-to-file test-log-to-file)) |
| 16 |
; Misc test-runner functions |
| 17 |
test-runner? test-runner-reset test-runner-null |
| 18 |
test-runner-simple test-runner-current test-runner-factory test-runner-get |
| 19 |
test-runner-create test-runner-test-name |
| 20 |
;; test-runner field setter and getter functions - see %test-record-define: |
| 21 |
test-runner-pass-count test-runner-pass-count! |
| 22 |
test-runner-fail-count test-runner-fail-count! |
| 23 |
test-runner-xpass-count test-runner-xpass-count! |
| 24 |
test-runner-xfail-count test-runner-xfail-count! |
| 25 |
test-runner-skip-count test-runner-skip-count! |
| 26 |
test-runner-group-stack test-runner-group-stack! |
| 27 |
test-runner-on-test-begin test-runner-on-test-begin! |
| 28 |
test-runner-on-test-end test-runner-on-test-end! |
| 29 |
test-runner-on-group-begin test-runner-on-group-begin! |
| 30 |
test-runner-on-group-end test-runner-on-group-end! |
| 31 |
test-runner-on-final test-runner-on-final! |
| 32 |
test-runner-on-bad-count test-runner-on-bad-count! |
| 33 |
test-runner-on-bad-end-name test-runner-on-bad-end-name! |
| 34 |
test-result-alist test-result-alist! |
| 35 |
test-runner-aux-value test-runner-aux-value! |
| 36 |
;; default/simple call-back functions, used in default test-runner, |
| 37 |
;; but can be called to construct more complex ones. |
| 38 |
test-on-group-begin-simple test-on-group-end-simple |
| 39 |
test-on-bad-count-simple test-on-bad-end-name-simple |
| 40 |
test-on-final-simple test-on-test-end-simple) |
| 41 |
(import |
| 42 |
(rnrs base) |
| 43 |
(rnrs control) |
| 44 |
(rnrs exceptions) |
| 45 |
(rnrs io simple) |
| 46 |
(rnrs lists) |
| 47 |
(rename (rnrs eval) (eval rnrs:eval)) |
| 48 |
(rnrs mutable-pairs) |
| 49 |
(srfi :0 cond-expand) |
| 50 |
(only (srfi :1 lists) reverse!) |
| 51 |
(srfi :6 basic-string-ports) |
| 52 |
(srfi :9 records) |
| 53 |
(srfi :39 parameters) |
| 54 |
(srfi :23 error tricks) |
| 55 |
(srfi private include)) |
| 56 |
|
| 57 |
(define (eval form) |
| 58 |
(rnrs:eval form (environment '(rnrs) |
| 59 |
'(rnrs eval) |
| 60 |
'(rnrs mutable-pairs) |
| 61 |
'(rnrs mutable-strings) |
| 62 |
'(rnrs r5rs)))) |
| 63 |
|
| 64 |
(define %test-log-to-file |
| 65 |
(case-lambda |
| 66 |
(() test-log-to-file) |
| 67 |
((val) (set! test-log-to-file val)))) |
| 68 |
|
| 69 |
(SRFI-23-error->R6RS "(library (srfi :64 testing))" |
| 70 |
(include/resolve ("srfi" "%3a64") "testing-impl.scm")) |
| 71 |
|
| 72 |
(set! test-log-to-file #F) |
| 73 |
) |