package tezt

  1. Overview
  2. Docs
Test framework for unit tests, integration tests, and regression tests

Install

Dune Dependency

Authors

Maintainers

Sources

tezt-3.0.0.tar.bz2
md5=362773eb411d8a62fd3c6ec25c5a1f0e
sha512=c56c705b28f4399223576563f4ca0168c818adc57d9f0710cd1eaa5185fc26cf321de5f6f3ede7125ce5f5922c5e0456d3044c23acc6fa12b466fe23ca9d48a7

doc/tezt.core/Tezt_core/Log/index.html

Module Tezt_core.LogSource

Tezt logs.

Sourceval quote_shell : string -> string

Quote or escape a string using shell syntax.

Sourceval quote_shell_command : string -> string list -> string

Quote or escape a command with arguments using shell syntax.

Colors

Sourcemodule Color : sig ... end

Logging

Sourceval log : level:Cli.log_level -> ?color:Color.t -> ?prefix:string -> ('a, Format.formatter, unit, unit) format4 -> 'a

Log a message if the log level requested on the command-line allows it.

See the documentation of Cli for a description of each log level and when to use them.

In tests, you should mostly use function info.

Sourceval debug : ?color:Color.t -> ?prefix:string -> ('a, Format.formatter, unit, unit) format4 -> 'a

Same as log ~level:Debug.

Sourceval info : ?color:Color.t -> ?prefix:string -> ('a, Format.formatter, unit, unit) format4 -> 'a

Same as log ~level:Info.

Sourceval report : ?color:Color.t -> ?prefix:string -> ('a, Format.formatter, unit, unit) format4 -> 'a

Same as log ~level:Report.

Sourceval warn : ('a, Format.formatter, unit, unit) format4 -> 'a

Same as log ~level:Warn ~color:red ~prefix:"warn".

Sourceval error : ('a, Format.formatter, unit, unit) format4 -> 'a

Same as log ~level:Error ~color:red ~prefix:"error".

Sourcetype test_result =
  1. | Successful
  2. | Failed of string
  3. | Aborted

Whether a test succeeded, failed or was aborted by the user.

Failed comes with the error message, which is a string version of the exception that was raised (usually with Test.fail). This message is unused by the Log module itself.

Sourceval test_result : test_index:int -> test_count:int -> failure_count:int -> iteration:int -> test_result -> string -> unit

Log the result of a test.

test_index is the index of the test, starting from 1. test_count is the total number of tests. failure_count is the total number of failures so far.

iteration is the index of the iteration count to display in --loop mode.

The string argument is the name of the test.

Sourceval command : ?color:Color.t -> ?prefix:string -> string -> string list -> unit

Log a command which will be run.

Log it with level Debug, and print it unconditionally with no timestamp if Cli.options.commands is true.

OCaml

Innovation. Community. Security.

On This Page
  1. Colors
  2. Logging