From 00f895bb09b2f3fe044c4707131b043a122cc4b6 Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Fri, 3 Aug 2018 11:49:28 +0000 Subject: [PATCH] Quickstart: use short test stanza In addition, document convention for expect tests. Signed-off-by: Etienne Millon --- doc/quick-start.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/quick-start.rst b/doc/quick-start.rst index 2c62f441..1fcad89b 100644 --- a/doc/quick-start.rst +++ b/doc/quick-start.rst @@ -250,10 +250,7 @@ Write this in your ``dune`` file: .. code:: scheme - (alias - (name runtest) - (deps (:my-prog my-test-program.exe)) - (action (run %{my-prog}))) + (test (name my_test_program)) And run the tests with: @@ -261,6 +258,18 @@ And run the tests with: 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 ==========================