Module QCheck2.TestResult
Result of running a test
type 'a counter_ex={instance : 'a;The counter-example
shrink_steps : int;How many shrinking steps for this counter-example
msg_l : string list;Messages of the test. Currently only populated by
Test.fail_reportandTest.fail_reportf.- since
- 0.7
}A counter-example when a test fails.
type 'a state=|SuccessIf the test passed.
|Failed of{instances : 'a counter_ex list;Failed instance(s)
}If the test failed "normally", i.e. a test returned
false.|Failed_other of{msg : string;}If the test failed for an unusual reason:
- an exception was raised by a generator
- too many assumptions failed and
Test.if_assumptions_failwas set to`Fatal
|Error of{instance : 'a counter_ex;Instance that triggered the exception in the test
exn : exn;The raised exception
backtrace : string;A best-effort backtrace of the exception
}If the test failed "exceptionally" (an exception was raised by the test).
Result state.
changed in 0.10 (move to inline records, add Fail_other)
val get_count : _ t -> intget_count treturns the number of tests executed.
val get_count_gen : _ t -> intget_count_gen treturns the number of generated cases.
val get_collect : _ t -> (string, int) Stdlib.Hashtbl.t optionget_collect treturns the repartition of generated values.- since
- 0.18
val get_stats : 'a t -> ('a stat * (int, int) Stdlib.Hashtbl.t) listget_stats treturns the statistics captured by the test.- since
- 0.18
val get_warnings : _ t -> string listget_warnings treturns the list of warnings emitted during the test.- since
- 0.18
val get_instances : 'a t -> 'a listget_instances treturns the generated instances, with no guarantee on the order.- since
- 0.18
val is_success : _ t -> boolReturns true iff the state if
Success- since
- 0.9
val stats : 'a t -> ('a stat * (int, int) Stdlib.Hashtbl.t) listObtain statistics
- since
- 0.6
- deprecated
use
get_statsinstead
val warnings : _ t -> string listObtain list of warnings
- since
- 0.10
- deprecated
use
get_warningsinstead
val collect : _ t -> (string, int) Stdlib.Hashtbl.t optionObtain statistics
- since
- 0.6
- deprecated
use
get_collectinstead