package ounit

  1. Overview
  2. Docs
Unit testing framework loosely based on HUnit. It is similar to JUnit, and other XUnit testing frameworks

Install

Dune Dependency

Authors

Maintainers

Sources

ounit-2.0.8.tar.gz
sha256=2e30fe79648e928b5a9d20f83d5a1a805826c7193e821464a9e4752661ba2e0e
md5=bd12d66c9dbd95a50570bb686b0f10f5

doc/oUnit/OUnit2/Conf/index.html

Module OUnit2.Conf

Define command line options, environment variables and file configuration.

This module helps to define configuration options that are translated to command line options et al.

The name defined for the variable is:

  • should be a valid OCaml identifier
  • kept as is for use in configuration file. (foo_bar = "")
  • '_' are replaced by '-' and a leading '-' is added for command line (-foo "")
  • capitalized and prefixed by OUNIT_ for environment (OUNIT_FOO_BAR="")
type 'a conf_t = string -> 'a -> Arg.doc -> test_ctxt -> 'a

The default type of function that create a configuration option of type 'a.

val make_string : string conf_t

make_string name default help Create a string configuration option with default value default and a short help string. The result of the partial application of the function can be used inside tests to be evaluated to a value.

let my_option = Conf.make_string "my_option" "the default" "A default option."

let tests =
  "ATest" >::
  (fun test_ctxt -> let option_value = my_option test_ctxt in ())
val make_string_opt : string option conf_t

Create a string option configuration option. See !make_string.

val make_int : int conf_t

Create an int configuration option. See !make_string.

val make_float : float conf_t

Create a float configuration option. See !make_string.

val make_bool : bool conf_t

Create a bool configuration option. See !make_string.

val make_exec : string -> test_ctxt -> string

make_exec execname Create a option to define an executable.

OCaml

Innovation. Community. Security.