Skip to content

Commit e3c1dba

Browse files
committed
Add documentation and update Changelog
1 parent d7636c4 commit e3c1dba

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Add the protect-call optional argument
4+
[\#205](https://github.com/ocaml-gospel/ortac/pull/205)
35
- Add a comment warning that the file is generated
46
[\#198](https://github.com/ocaml-gospel/ortac/pull/198)
57
- Add an include option to qcheck-stm cli

plugins/qcheck-stm/doc/index.mld

+16
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ In order to generate postcondition-checking, Ortac/QCheck-STM uses the
141141
[ensures] clauses that were not used for the [next_state] function but it also
142142
uses the [checks] clauses and the [raises] ones.
143143

144+
{1 How to generate the test file }
145+
144146
Now you can generate the QCheck-STM file by running the following command where
145147
you indicate the file you want to test, the function call to build a value of
146148
the type indicated in the third argument. You can write the generated code into
@@ -177,6 +179,20 @@ like the following:
177179
(run %{test} --verbose)))
178180
]}
179181

182+
There are other optional argument that are worth detailing here.
183+
184+
The first one is the [-i] optional argument, taking the name of the module to
185+
include in the generated code. This is a flexible way to provide pretty
186+
pinters, QCheck generators and extenstions to the [STM.ty] type.
187+
188+
The second one is the [-p] optional argument, taking a string. The string
189+
should be the name of a function, and the function will be protecting the call
190+
to the generated tests. The function should be implemented in the included
191+
module (the one passed to the [-i] optional argument). The funciton is of type
192+
[(unit -> unit) -> unit]. That means that it takes the suspended call the the
193+
generated tests as argument, so don't forget to launch them when implementing
194+
the function. One use case of this optional argument is to set up a [Lwt]
195+
scheduler berfore running the tests.
180196
{1 Warning system}
181197

182198
Now that you know what Gospel specifications for the [qcheck-stm] plugin should

0 commit comments

Comments
 (0)