Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate cleanup function with custom code #208

Closed
Lucccyo opened this issue Mar 12, 2024 · 2 comments · Fixed by #226
Closed

Generate cleanup function with custom code #208

Lucccyo opened this issue Mar 12, 2024 · 2 comments · Fixed by #226
Labels
enhancement New feature or request good first issue Good for newcomers qcheck-stm

Comments

@Lucccyo
Copy link

Lucccyo commented Mar 12, 2024

We use Ortac to test the implementation of Mirage_kv, a key-value store existing on a disk. To establish a connection to this disk, we utilise the interface of Mirage_block. If we highthen the number of QCheck tests, an excessive number of operations are sent to the disk, leading to blockages.
We would like Ortac to generate a cleanup function incorporating our cleanup function, Mirage_block.disconnect. This will allow the disk to take a breath and enable us to continue testing with a fresh disk.

@n-osborne
Copy link
Collaborator

Thanks for raising this issue :-)

Indeed we haven't tackle the question of the cleanup function asked for the STM.Spec module. For now, we are generating a dummy one as it is the most used when testing data structures.

This fall under the user-provided information, as we can't guess the body of the cleanup function.

So I would suggest to do something similar to the init_state function, but with an optional argument (as most of the time, the user will want the dummy function).

@n-osborne n-osborne added enhancement New feature or request good first issue Good for newcomers qcheck-stm labels Mar 13, 2024
@n-osborne
Copy link
Collaborator

#214 proposes to move to a module-based configuration.

In this case, the user can add the cleanup function in the configuration module. If present, the generated code will use it, if absent ortac will generate the dummy one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers qcheck-stm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants