forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oUnitTypes.ml
57 lines (46 loc) · 1.08 KB
/
oUnitTypes.ml
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
(**
* Commont types for OUnit
*
* @author Sylvain Le Gall
*
*)
(** See OUnit.mli. *)
type node = ListItem of int | Label of string
(** See OUnit.mli. *)
type path = node list
(** See OUnit.mli. *)
type log_severity =
| LError
| LWarning
| LInfo
(** See OUnit.mli. *)
type test_result =
| RSuccess of path
| RFailure of path * string
| RError of path * string
| RSkip of path * string
| RTodo of path * string
(** See OUnit.mli. *)
type test_event =
| EStart of path
| EEnd of path
| EResult of test_result
| ELog of log_severity * string
| ELogRaw of string
(** Events which occur at the global level. *)
type global_event =
| GStart (** Start running the tests. *)
| GEnd (** Finish running the tests. *)
| GResults of (float * test_result list * int)
(* The type of test function *)
type test_fun = unit -> unit
(* The type of tests *)
type test =
| TestCase of test_fun
| TestList of test list
| TestLabel of string * test
type state =
{
tests_planned : (path * (unit -> unit)) list;
results : test_result list;
}