Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file cli_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869(*
* Copyright (c) 2013-2016 Thomas Gazagnaire <thomas@gazagnaire.org>
* Copyright (c) 2019 Craig Ferguson <me@craigfe.io>
*
* 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.
*)open!ImportmoduleV1_types=structmoduletypeS=sigincludeCore.V1.S(** @inline *)valrun:(?argv:stringarray->string->unittestlist->return)with_options(** [run n t] runs the test suite [t]. [n] is the name of the tested
library.
The optional argument [and_exit] controls what happens when the function
ends. By default, [and_exit] is set, which makes the function exit with
[0] if everything is fine or [1] if there is an issue. If [and_exit] is
[false], then the function raises [Test_error] on error.
The optional argument [argv] specifies command line arguments sent to
alcotest like ["--json"], ["--verbose"], etc. Note that this array will
be treated like a regular [Sys.argv], so the array must have at least
one element, and the first element will be treated as if it was the
command name and thus ignored for the purposes of option processing. So
[~argv:[||]] is an error, [~argv:[| "--verbose" |]] will have no effect,
and [~argv:[| "ignored"; "--verbose" |]] will successfully pass the
verbose option. *)valrun_with_args:(?argv:stringarray->string->'aCmdliner.Term.t->'atestlist->return)with_options(** [run_with_args n a t] Similar to [run a t] but take an extra argument
[a]. Every test function will receive as argument the evaluation of the
[Cmdliner] term [a]: this is useful to configure the test behaviors
using the CLI. *)endmoduletypeMAKER=functor(_:Platform.MAKER)(M:Monad.S)->Swithtypereturn=unitM.tendmoduletypeCli=sigmoduleV1:sigmoduletypeS=V1_types.SmoduletypeMAKER=V1_types.MAKERmoduleMake(_:Platform.MAKER)(M:Monad.S):V1_types.Swithtypereturn=unitM.tendend