package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-libs.tezt-wrapper/Tezt_wrapper/Uses/index.html

Module Tezt_wrapper.UsesSource

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.

Note that some uses are added by default to all tests. See section Default Uses below.

Sourcetype t

Test dependencies.

Sourceval 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.

Sourceval path : t -> string

Get the path of a test dependency.

Sourceval tag : t -> string

Get the tag of a test dependency.

Sourceval lookup : string -> t option

Get the first Uses.t that was created using make for a given path.

Paths are considered equal modulo some inconsequential variations. For instance, "./bin//./octez-node" and "bin/octez-node" are considered equivalent.

Default Uses

The following uses are added by default, but can be removed by specifying ~uses_node:false or ~uses_client:false.

Sourceval octez_node : t

"./octez-node", with tag "node".

Sourceval octez_client : t

"./octez-client", with tag "client".

Sourceval octez_admin_client : t

"./octez-admin-client", with tag "admin_client".

Sourceval register_meta_test : unit -> unit

Register a test that generates:

  tezt/lib_wrapper/expected/tezt_wrapper.ml/runtime-dependency-tags.out

This file can be used by the manifest to deduce which tests to run. By having this be a regression test, we guarantee that this list is always up-to-date and that there is only one source of truth.

To regenerate the file, run:

  dune exec tezt/tests/main.exe -- \
    --reset-regressions -t 'meta: list runtime dependencies'

Since the contents of the file depends on the tests which are registered, but the file is always the same, this function should only be called by the executable that is linked with all tests, i.e. tezt/tests/main.exe.

OCaml

Innovation. Community. Security.