package ounit

  1. Overview
  2. Docs

Module OUnitTestSource

Sourceexception Skip of string
Sourceexception Todo of string
Sourceexception OUnit_failure of string
Sourcetype node =
  1. | ListItem of int
  2. | Label of string

See OUnit.mli.

Sourcetype path = node list

See OUnit.mli.

Sourcetype backtrace = string option

See OUnit2.mli.

Sourcetype test_length =
  1. | Immediate
  2. | Short
  3. | Long
  4. | Huge
  5. | Custom_length of float
Sourcetype result =
  1. | RSuccess
  2. | RFailure of string * OUnitLogger.position option * backtrace
  3. | RError of string * backtrace
  4. | RSkip of string
  5. | RTodo of string
  6. | RTimeout of test_length

See OUnit.mli.

Sourcetype result_full = path * result * OUnitLogger.position option
Sourcetype result_list = result_full list
Sourcetype ctxt = {
  1. conf : OUnitConf.conf;
  2. logger : logger;
  3. shared : OUnitShared.shared;
  4. path : path;
  5. test_logger : result OUnitLogger.Test.t;
  6. mutable tear_down : (ctxt -> unit) list;
  7. tear_down_mutex : OUnitShared.Mutex.t;
  8. non_fatal : result_full list ref;
  9. non_fatal_mutex : OUnitShared.Mutex.t;
  10. initial_environment : string array;
}
Sourcetype test_fun = ctxt -> unit
Sourcetype test =
  1. | TestCase of test_length * test_fun
  2. | TestList of test list
  3. | TestLabel of string * test
Sourceval delay_of_length : test_length -> float
Sourceval get_shard_id : ctxt -> string
Sourceval section_ctxt : ctxt -> (ctxt -> 'a) -> 'a

Isolate a function inside a context. All the added tear down will run before returning.

Sourceval with_ctxt : OUnitConf.conf -> logger -> OUnitShared.shared -> result_full list ref -> path -> (ctxt -> 'a) -> 'a

Create a context and run the function.

Sourceval standard_modules : string list
Sourceval result_full_of_exception : ctxt -> exn -> path * result * OUnitLogger.position option

Transform an exception in a result.

Sourceval report_result_full : ctxt -> (path * result * 'a) -> path * result * 'a
Sourceval non_fatal : ctxt -> (ctxt -> unit) -> unit

Isolate a function inside a context, just as !section_ctxt but don't propagate a failure, register it for later.

Sourceval (>:) : string -> test -> test
Sourceval (>::) : string -> test_fun -> test
Sourceval (>:::) : string -> test list -> test
Sourceval test_decorate : (test_fun -> test_fun) -> test -> test
Sourceval test_case_count : test -> int
Sourceval string_of_node : node -> string
Sourcemodule Path : sig ... end
Sourcemodule MapPath : sig ... end
Sourceval string_of_path : node list -> string
Sourceval test_case_paths : test -> node list list
Sourcemodule SetTestPath : sig ... end
Sourceval test_filter : ?skip:bool -> SetTestPath.elt list -> test -> test option
OCaml

Innovation. Community. Security.