package octez-alcotezt

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Wrapper to run Alcotest tests with Tezt as a backend.

This module provides a subset of the interface of the Alcotest module of the real Alcotest library. But instead of using Alcotest to run the tests, it uses Tezt. This allows to transition from Alcotest to Tezt without having to actually change the code. In turn, this allows to benefit from Tezt features such as auto-balancing in the CI. One can then use Tezt's modules in the test, to gradually migrate the test to Tezt and stop using this wrapper.

type return = unit Lwt.t

Return type for tests.

type speed_level = [
  1. | `Quick
  2. | `Slow
]

Speed levels.

In Alcotest, one can ask not to run slow tests with -q from the command-line. In Tezt, the equivalent is -a quick.

type 'a test_case = string * speed_level * ('a -> return)

Test cases.

The name of the Alcotest test case appears in Tezt's logs, but it is not used in the Tezt test title, nor as a tag.

val test_case : string -> speed_level -> (Lwt_switch.t -> 'a -> return) -> 'a test_case

Make a test case.

val test_case_sync : string -> speed_level -> ('a -> unit) -> 'a test_case

Make a test case (out of Lwt).

type 'a test = string * 'a test_case list

Tests.

In Tezt, the name of the test is used as the title of the test.

val run : __FILE__:string -> string -> unit test list -> return

Run a test suite.

In Tezt, this calls Test.register but does not actually run the test suite. The name of the test suite is used as the filename for the Tezt test.

OCaml

Innovation. Community. Security.