Quickstart: use short test stanza
In addition, document convention for expect tests. Signed-off-by: Etienne Millon <me@emillon.org>
This commit is contained in:
parent
55dbe740c6
commit
00f895bb09
|
@ -250,10 +250,7 @@ Write this in your ``dune`` file:
|
||||||
|
|
||||||
.. code:: scheme
|
.. code:: scheme
|
||||||
|
|
||||||
(alias
|
(test (name my_test_program))
|
||||||
(name runtest)
|
|
||||||
(deps (:my-prog my-test-program.exe))
|
|
||||||
(action (run %{my-prog})))
|
|
||||||
|
|
||||||
And run the tests with:
|
And run the tests with:
|
||||||
|
|
||||||
|
@ -261,6 +258,18 @@ And run the tests with:
|
||||||
|
|
||||||
dune runtest
|
dune runtest
|
||||||
|
|
||||||
|
It will run the test program (the main module is ``my_test_program.ml``) and
|
||||||
|
error if it exits with a nonzero code.
|
||||||
|
|
||||||
|
In addition, if a ``my_test_program.expected`` file exists, it will be compared
|
||||||
|
to the standard output of the test program and the differences will be
|
||||||
|
displayed. It is possible to replace the ``.expected`` file with the last output
|
||||||
|
using:
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
dune promote
|
||||||
|
|
||||||
Building a custom toplevel
|
Building a custom toplevel
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue