blob: 05dccff31907cc1b6d84c192867294944825e631 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
(((name . "set-displayable!")
(signature
case-lambda
(((procedure? predicate?) (procedure? transformer)) *)
(((test-runner? runner) (procedure? predicate?) (procedure? transformer)) *))
(subsigs
(predicate? (lambda (*) boolean?))
(transformer (lambda ((test-runner? runner) (predicate? value)) *)))
(desc "
Adds a new display transformer to the test runner. If no test runner is
specified, adds a new display transformer to the current test runner.
For information about how the test runner transforms values, see the
documentation for `make-displayable`.
The use of this function in conjunction with `make-displayable` makes it
possible to rewrite recursive structures. For example, to translate a
custom record type for the current test runner:
(define-record-type <my-record-type>
(my-record-type field1 field2)
my-record-type?
(field1 get-field1)
(field2 get-field2))
(set-displayable! my-record-type?
(lambda (runner value)
(list '<my-record-type>
(make-displayable runner (get-field1 value))
(make-displayable runner (get-field2 value)))))
"))
((name . "make-displayable")
(signature lambda ((test-runner? runner) value) *)
(desc "
Attempts to make `value` displayable using the display transformers in
`runner`.
Whenever test results are written to the screen, the list of display
transformers for that test runner are used to rewrite the test results to
be writeable using `write`. This is used to make normally unprintable
values such as `define-record-type` records printable.
Whenever `make-displayable` is called with a value,
the `predicate?` of each transformer in `runner` is checked, newest first,
and if any of the `predicate?` procedures return true, the `transformer`
procedure is called with the runner as the first argument and the value
as the second argument.
"))
((name . "dynamic-property-set!")
(signature
case-lambda
((property value) *)
(((test-runner? runner) property value) *))
(desc "
Add `(cons property value)` to the dynamic property alist of runner. The
dynamic properties of the runner are printed out at the end of a run and
are discarded after the end of a test."))
((name . "set-verbosity!")
(signature
case-lambda
((value) *)
(((test-runner? runner) value *)))
(desc "
Set verbosity of the runner.
If `value` is `fails`, then only report failures. Otherwise report failures
and successes."))
((name . "test-call")
(signature
syntax-rules ()
((_ name (procedure args ...))))
(desc "
Call `procedure` with `args` and test name `name`. The evaluated form of
`procedure` and `args` are added to the test output."))
((name . "factory")
(signature lambda () test-runner?)
(desc "
An SRFI-64 factory, suitable for passing to `test-runner-factory`.")))
|