package alcotest

  1. Overview
  2. Docs
Alcotest is a lightweight and colourful test framework

Install

Dune Dependency

Authors

Maintainers

Sources

alcotest-1.9.0.tbz
sha256=e2387136ca854df2b4152139dd4d4b3953a646e804948073dedfe0a232f08a15
sha512=ba38fe4a9061b001d274e5d41fb06c10c84120570fc00dc57dc5a06ba05176c2413295680d839f465ba91469ea99d7e172a324e26f005d6e8c4d98fca7657241

doc/alcotest.engine/Alcotest_engine/V1/Cli/Make/argument-1-_/index.html

Parameter Make._

Parameters

module M : Monad.S

Signature

val time : unit -> float

time () returns the current timestamp, used to measure the duration of a testrun.

val getcwd : unit -> string

getcwd () returns the current working directory.

val stdout_isatty : unit -> bool

Return true if standard output refers to a terminal or console window, false otherwise.

val stdout_columns : unit -> int option

stdout_columns () is the current width of stdout in columns, or None if no width can be determined (e.g. stdout is not a TTY).

val setup_std_outputs : ?style_renderer:Fmt.style_renderer -> ?utf_8:bool -> Formatters.stdout -> Formatters.stderr -> unit

setup_std_outputs ~style_renderer ~utf_8 stdout stderr is called at startup of alcotest and sets up the standard streams for colored output.

val log_trap_supported : bool

Whether or not the test runner should trap test logs. The following functions are used iff this is set to true.

val prepare_log_trap : root:string -> uuid:string -> name:string -> unit

prepare ~root ~uuid ~name is called before test suite execution.

  • root is the directory used for log capturing;
  • uuid is the unique test execution ID;
  • name is the suite name.
type file_descriptor
val file_exists : string -> bool
val open_write_only : string -> file_descriptor
val close : file_descriptor -> unit
val with_redirect : file_descriptor -> (unit -> 'a M.t) -> 'a M.t

with_redirect fd f is called for each test. On Unix, it deals with redirection of standard streams to the fd.

val home_directory : unit -> (string, [ `Msg of string ]) result

home_directory () is the current user's HOME directory, if it exists.

OCaml

Innovation. Community. Security.