0b4828c0dc52 draft — orbitz 6 years ago
ADD raw_test concept to make it possible to implement other test execution paths
2 files changed, 6 insertions(+), 0 deletions(-)

M src/oth/oth.ml
M src/oth/oth.mli
M src/oth/oth.ml +3 -0
@@ 20,6 20,7 @@ end
 
 module Run_result = struct
   type t = Test_result.t list
+  let of_test_results = CCFun.id
   let test_results = CCFun.id
 end
 

          
@@ 155,6 156,8 @@ let test ?desc ~name f state =
   let (duration, res) = time_test state f in
   Test_result.([{ name; desc; duration; res }])
 
+let raw_test f state = f state
+
 let result_test rtest state =
   let res = rtest state in
   match res with

          
M src/oth/oth.mli +3 -0
@@ 23,6 23,7 @@ end
     undefined. *)
 module Run_result : sig
   type t
+  val of_test_results : Test_result.t list -> t
   val test_results : t -> Test_result.t list
 end
 

          
@@ 80,6 81,8 @@ val timeout : Duration.t -> Test.t -> Te
 (** Turn a function into a test *)
 val test : ?desc:string -> name:string -> (State.t -> unit) -> Test.t
 
+val raw_test : (State.t -> Run_result.t) -> Test.t
+
 (** Name a test. This is useful for naming loops or grouped tests in order to
     see the time and a named output but not for each individual run.