The current Alcotest API exposes a rigid test structure:
type 'a test_case = string * speed_level * ('a -> return)
type 'a test = string * 'a test_case list
type 'a suite = 'a test list
In particular, there is one level of nesting with each leaf being assigned a speed_level.
Beyond ease of implementation, I don't see any reason why we couldn't support arbitrary nesting of test groups. For example, bechamel uses an API like the following:
module Test : sig
type 'a t
val v : name:string -> ('a -> return) -> 'a t
val group : name:string -> 'a t list -> 'a t
end
Something like this would probably support a wider range of test suite sizes. We could implement the older API in terms of the new one inside an Alcotest.V1.
Making the Test.t abstract would also allow making the [ `Quick | `Slow ] distinction optional / customizable.
The current Alcotest API exposes a rigid test structure:
In particular, there is one level of nesting with each leaf being assigned a
speed_level
.Beyond ease of implementation, I don't see any reason why we couldn't support arbitrary nesting of test groups. For example,
bechamel
uses an API like the following:Something like this would probably support a wider range of test suite sizes. We could implement the older API in terms of the new one inside an
Alcotest.V1
.Making the
Test.t
abstract would also allow making the[ `Quick | `Slow ]
distinction optional / customizable.