12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697(*
* Copyright (c) 2013-2016 Thomas Gazagnaire <thomas@gazagnaire.org>
* Copyright (c) 2019 Craig Ferguson <craig@tarides.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)openModeltypetheta=Format.formatter->unit(** Type corresponding to a [%t] placeholder. *)moduleTypes=structtypeevent=[`ResultofTest_name.t*Run_result.t|`StartofTest_name.t]typeresult={success:int;failures:int;time:float;errors:unitFmt.tlist;}endmoduletypeMake_arg=sigvalstdout_columns:unit->intoptionendmoduletypeS=sigincludemoduletypeofTypesvalinfo:?available_width:int->max_label:int->doc_of_test_name:(Test_name.t->string)->Test_name.tFmt.tvalrresult_error:Run_result.tFmt.tvalevent_line:margins:int->max_label:int->doc_of_test_name:(Test_name.t->string)->[`ResultofTest_name.t*[<Run_result.t]|`StartofTest_name.t]Fmt.tvalevent:isatty:bool->compact:bool->max_label:int->doc_of_test_name:(Test_name.t->string)->selector_on_failure:bool->tests_so_far:int->eventFmt.tvalsuite_results:log_dir:theta-><verbose:bool;show_errors:bool;json:bool;compact:bool;..>->resultFmt.tvalquoted:'aFmt.t->'aFmt.t(** Wraps a formatter with `GNU-style quotation marks'. *)valwith_surrounding_box:'aFmt.t->'aFmt.t(** Wraps a formatter with a Unicode box with width given by
{!X.stdout_columns}. Uses box-drawing characters from code page 437. *)valhorizontal_rule:_Fmt.t(** Horizontal rule of length {!X.stdout_columns}. Uses box-drawing characters
from code page 437. *)valuser_error:string->_(** Raise a user error, then fail. *)endmoduletypePp=sigvaltag:[`Ok|`Fail|`Skip|`Todo|`Assert]Fmt.tvalmap_theta:theta->f:(unitFmt.t->unitFmt.t)->thetavalpp_plural:intFmt.t(** This is for adding an 's' to words that should be pluralized, e.g.
{[
let n = List.length items in
Fmt.pr "Found %i item%a." n pp_plural n
]} *)moduleMake(X:Make_arg):Send