Skip to content

Commit

Permalink
Document inline test partitioning
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo Heuzard <[email protected]>
  • Loading branch information
hhugo committed Feb 9, 2023
1 parent f990697 commit 3350fce
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions doc/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -358,21 +358,23 @@ empty library with your chosen backend's name.
In order to define a library as an inline tests backend, simply add an
``inline_tests.backend`` field to the library stanza. An inline tests
backend is specified by three parameters:
backend is specified by four parameters:
1. How to create the test runner
2. How to build the test runner
3. How to run the test runner
4. Optionaly how to run the test runner to list partitions
These three parameters can be specified inside the
These four parameters can be specified inside the
``inline_tests.backend`` field, which accepts the following fields:
.. code:: scheme
(generate_runner <action>)
(runner_libraries (<ocaml-libraries>))
(flags <flags>)
(extends (<backends>))
(generate_runner <action>)
(runner_libraries (<ocaml-libraries>))
(flags <flags>)
(list_partitions_flags <flags>)
(extends (<backends>))
For instance:
Expand All @@ -399,6 +401,11 @@ If your test runner needs specific flags, you should pass them in the
``flags`` field. You can use the ``%{library-name}`` variable in this
field.
If your test runner supports test partitions, you should pass the
flags necessary for listing partitions in the
``list_partitions_flags`` field. In such scenario, the ``flags`` field
will also accepts a ``%{partition}`` variable.
Finally, a backend can be an extension of another backend. In this
case, you must specify this in the ``extends`` field. For instance,
ppx_expect_ is an extension of ppx_inline_test_. It's possible to use
Expand Down

0 comments on commit 3350fce

Please sign in to comment.