# HG changeset patch # User orbitz # Date 1490550031 -7200 # Sun Mar 26 19:40:31 2017 +0200 # Node ID 0b4828c0dc52628397021f42746c0235103e16ea # Parent 37f311116712da3ee5a0c96c7bf489a9942f5be0 ADD raw_test concept to make it possible to implement other test execution paths diff --git a/src/oth/oth.ml b/src/oth/oth.ml --- a/src/oth/oth.ml +++ b/src/oth/oth.ml @@ -20,6 +20,7 @@ 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 (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 diff --git a/src/oth/oth.mli b/src/oth/oth.mli --- a/src/oth/oth.mli +++ b/src/oth/oth.mli @@ -23,6 +23,7 @@ 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 @@ (** 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.