diff options
author | Damien Doligez <damien.doligez@inria.fr> | 2022-06-02 15:06:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 15:06:17 +0200 |
commit | 0dff10145a9a2dd94eeef396a822680a2bc72112 (patch) | |
tree | 003725480e1195fec3b6d80150338818b0f66776 /ocamltest/ocamltest.org | |
parent | 09ed8dfa28fd1d4a6576aac0ada6d1e0fde7a0e7 (diff) | |
download | ocaml-0dff10145a9a2dd94eeef396a822680a2bc72112.tar.gz |
Ocamltest documentation fixes (#11211)
* Remove leftover "ocamltests" file.
* Small fixes for the ocamltest documentation.
Diffstat (limited to 'ocamltest/ocamltest.org')
-rw-r--r-- | ocamltest/ocamltest.org | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/ocamltest/ocamltest.org b/ocamltest/ocamltest.org index 20651fc705..e1c3fa70fa 100644 --- a/ocamltest/ocamltest.org +++ b/ocamltest/ocamltest.org @@ -171,13 +171,8 @@ above into a test usable by ocamltest to verify this: 4. Finally, there is one extra step required if we want our newly created test to be run automatically as part of the OCaml compiler's test suite. We need to move =hello.ml= and =hello.reference= to a directory (say - =newtest=) located somewhere - below =testsuite/tests= in the compiler's source tree and we - need to declare the test. This is done by appending the name of the - file containing the =(* TEST *)= comment to an =ocamltests= - (mark the final s) file located in the =newtest= directory, - alongside the other files relevant to the test. Once this is done, - the command + =newtest=) located somewhere below =testsuite/tests= in the compiler's + source tree. Once this is done, the command : make all executed in the =testsuite= directory of the OCaml compiler' source tree will run all the test suite, which now also includes our own test. @@ -235,7 +230,7 @@ actions does, let us take this opportunity to introduce a bit of ocamltest terminology. An /action/ is anything that can =pass=, =skip= or =fail=. A =test= is a sequence of such actions. Running a test thus means running each of its actions, in sequence, until all the -actions have been run or one of them returns =pass= or =skip=. Whatever +actions have been run or one of them returns =fail= or =skip=. Whatever the last run action returns, this value will be the result of the whole test. @@ -266,7 +261,6 @@ quite similar): 4. =run=:: now that the program has been successfully compiled, it is run with its standard output and error streams saved to a file. - 5. =check-program-output=:: this time it is the output of the program which is compared to a reference file, namely the =hello.reference= file created earlier. So far this comparison succeeds, because the @@ -402,7 +396,7 @@ modules = "greet.ml" let _ = Greet.greet "world" #+end_src -Provided that the =hello.compilers.reference= file previously to test +Provided that the =hello.compilers.reference= file previously used to test warnings is deleted, running ocamltest on =hello.ml= should work. It will also be worth looking at the two first lines of the log file generated while running the test. It says: @@ -618,7 +612,7 @@ actions and their detailed descriptions are given in chapters Two tests are provided to make sure that the OCaml top-level behaves as expected: =toplevel= and =expect=. These tests are similar in that they -both allow to test how the OCaml top-level reacts to some user input, +both allow testing how the OCaml top-level reacts to some user input, but they are different in the way one specifies the expected output and also in what they can test. The =toplevel= test behaves in a spirit similar to the compiler tests described above, meaning that the expected |