package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-libs.tezt-wrapper/Tezt_wrapper/Uses/index.html
Module Tezt_wrapper.Uses
Source
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.
Test dependencies.
Make a test dependency.
Multiple paths can be associated with the same tag, and the same paths can be associated with different tags.
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
.
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
.