package octez-libs

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

Test dependencies.

Test.register and Regression.register take an optional argument ?uses that allows to declare that the test uses a given file.

For instance, you can define:

let data = Uses.make ~tag:"data" ~path:"data/file.dat"

You would then:

  • declare your test with ~uses:[data];
  • use Uses.path data to get the path to your file.

~uses:[data] adds the tag of data to the test tags.

Uses.path data checks that the current test was declared with data in its ~uses. And when you declare a test with ~uses:[data], the test checks, at the end, that Uses.path data was called. This helps to maintain the invariant that a test that uses a given file has a given tag.

type t

Test dependencies.

val make : tag:string -> path:string -> t

Make a test dependency.

Multiple paths can be associated with the same tag, and the same paths can be associated with different tags.

val path : t -> string

Get the path of a test dependency.

val tag : t -> string

Get the tag of a test dependency.

OCaml

Innovation. Community. Security.