@@ -106,37 +106,50 @@ module Types = struct
106
106
end
107
107
108
108
module Unstable_types = struct
109
- module type S = sig
109
+ module type Test_constructors = sig
110
110
(* These types are intended to be destructively-substituted by various
111
111
backends. *)
112
112
113
113
type 'a m
114
114
type 'a test_args
115
115
type tag_set
116
- type config
116
+ type source_code_position
117
117
118
118
type 'a test
119
119
(* * The type of unit tests. *)
120
120
121
- type 'a extra_info = ?here:Source_code_position .here -> ?tags:tag_set -> 'a
122
- (* * Tests and test groups can be located by attaching source code positions
123
- to them. *)
124
-
125
- val test : (name :string -> ('a -> unit m ) test_args -> 'a test ) extra_info
121
+ val test :
122
+ ?here : source_code_position ->
123
+ ?tags : tag_set ->
124
+ name :string ->
125
+ ('a -> unit m ) test_args ->
126
+ 'a test
126
127
(* * [test ~name f] is a suite containing a single named test that runs [f].*)
127
128
128
- val group : (name :string -> 'a test list -> 'a test ) extra_info
129
+ val group :
130
+ ?here : source_code_position ->
131
+ ?tags : tag_set ->
132
+ name :string ->
133
+ 'a test list ->
134
+ 'a test
129
135
(* * [test_group ~name ts] *)
136
+ end
137
+
138
+ module type Test_runners = sig
139
+ type 'a m
140
+ type 'a test
141
+ type config
142
+ type source_code_position
130
143
131
144
val run :
132
- ?here : Source_code_position .here ->
145
+ ?here : source_code_position ->
133
146
?config : config ->
134
147
name :string ->
135
148
unit test list ->
136
149
unit m
137
150
138
151
val run_with_args :
139
- ?here : Source_code_position .here ->
152
+ ?here : source_code_position ->
140
153
?config : config ->
141
154
name :string ->
142
155
'a ->
@@ -145,22 +158,29 @@ module Unstable_types = struct
145
158
end
146
159
147
160
(* * Extensions to {!S} for use by backends. *)
148
- module type EXT = sig
149
- include S
161
+ module type S = sig
162
+ include Test_constructors
163
+
164
+ include
165
+ Test_runners
166
+ with type 'a m := 'a m
167
+ and type 'a test := 'a test
168
+ and type source_code_position := source_code_position
150
169
151
170
val list_tests :
152
- ?here : Source_code_position .here ->
171
+ ?here : source_code_position ->
153
172
?config : config ->
154
173
name :string ->
155
174
_ test list ->
156
175
unit m
157
176
end
158
177
159
178
module type MAKER = functor (P : Platform.MAKER ) (M : Monad.S ) ->
160
- EXT
179
+ S
161
180
with type 'a m := 'a M. t
162
181
and type 'a test_args := 'a
163
182
and type config := Config.User. t
183
+ and type source_code_position := Source_code_position. here
164
184
and type tag_set := Tag.Set. t
165
185
end
166
186
@@ -181,9 +201,7 @@ module type Core = sig
181
201
module Unstable : sig
182
202
type nonrec 'a identified = 'a identified
183
203
184
- module type S = Unstable_types. S
185
- module type MAKER = Unstable_types. MAKER
186
-
204
+ include module type of Unstable_types
187
205
module Make : MAKER
188
206
end
189
207
end
0 commit comments