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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
open OUnitTest
let (>:) = OUnitTest.(>:)
let (>::) = OUnitTest.(>::)
let (>:::) = OUnitTest.(>:::)
type test_ctxt = OUnitTest.ctxt
type test_fun = OUnitTest.test_fun
type test_length = OUnitTest.test_length
type test = OUnitTest.test
let test_case ?(length=Short) f = TestCase(length, f)
let test_list lst = TestList lst
type log_severity = OUnitLogger.log_severity
let assert_failure = OUnitAssert.assert_failure
let assert_bool = OUnitAssert.assert_bool
let assert_string = OUnitAssert.assert_string
let assert_command
?exit_code ?sinput ?foutput ?use_stderr ?backtrace ?chdir ?env ~ctxt
prg args =
OUnitAssert.assert_command
?exit_code ?sinput ?foutput ?use_stderr ?backtrace ?chdir ?env ~ctxt
prg args
let assert_equal = OUnitAssert.assert_equal
let assert_raises = OUnitAssert.assert_raises
let skip_if = OUnitAssert.skip_if
let todo = OUnitAssert.todo
let cmp_float = OUnitUtils.cmp_float
let bracket = OUnitBracket.create
let bracket_tmpfile = OUnitBracket.bracket_tmpfile
let bracket_tmpdir = OUnitBracket.bracket_tmpdir
let with_bracket_chdir test_ctxt dn f =
OUnitBracket.with_bracket test_ctxt
(OUnitBracket.bracket_chdir dn)
(fun _ -> f)
let non_fatal = OUnitTest.non_fatal
let run_test_tt_main = OUnitCore.run_test_tt_main
let logf ctxt log_severity fmt =
OUnitLogger.Test.logf ctxt.test_logger log_severity fmt
let in_testdata_dir ctxt path =
OUnitTestData.in_testdata_dir ctxt.conf path
let conf_wrap f name default help =
let get = f name default help in
fun ctxt -> get ctxt.conf
module Conf =
struct
type 'a conf_t = string -> 'a -> Arg.doc -> test_ctxt -> 'a
let make_string = conf_wrap OUnitConf.make_string
let make_string_opt = conf_wrap OUnitConf.make_string_opt
let make_int = conf_wrap OUnitConf.make_int
let make_float = conf_wrap OUnitConf.make_float
let make_bool = conf_wrap OUnitConf.make_bool
let make_exec name =
let get = OUnitConf.make_exec name in
fun ctxt -> get ctxt.conf
end