Module Osnap.Runner

type mode =
| Interactive(*

Interactive mode, diffs will be displayed and ask for promote

*)
| Promote(*

Promote mode, will promote every diff

*)
| Error(*

Error mode, raises error on diff

*)
type encoding =
| Marshal(*

Snapshot will be encoded using binaries with Marshal

*)
| Data_encoding(*

Snapshot will be encoded using a JSON with the library Data_encoding

*)
val run_tests : ?encoding:encoding -> ?mode:mode -> ?out:Stdlib.Format.formatter -> ?color:bool -> Test.t list -> int

run_tests tests runs suite of tests and print its results

  • returns

    an error code, 0 if all tests passed, 1 otherwise

  • parameter encoding,

    default is Marshal

  • parameter mode

    default is Error

  • parameter color,

    if true, colorful output

val run_tests_main : ?argv:string array -> Test.t list -> 'a

run_tests_main can be used as the main function of a test file. Exits with a non-0 code if the tests fail. It refers to run_tests for actually running tests after a CLI options have been parsed

The available options are:

  • "--mode <m>" (or "-m <m>") for running mode
  • "--color <b>" (or "-c <b>") for activating colors
  • "--encoding <e>" (or "-e <e>") for encoding mode