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

Add module-prefix optional argument to Ortac/QCheck-STM and Ortac/Dune #280

Merged
merged 8 commits into from
Dec 19, 2024

Conversation

n-osborne
Copy link
Collaborator

Fixes #268

This PR proposes to add a new optional argument to both Ortac/QCheck-STM and Ortac/Dune (the latter to use the former).
This new optional argument (-m or --module-prefix=) allows to test a module that is exposed as part of a library.

For example in:

(library
 (name myLib)
 (modules myModule))

You need to give myModule as the FILE argument, but it is not the right identifier for the module to open in the tests.

With this patch, you can run:

$ ortac qcheck-stm myModule.mli myConf.ml --module-prefix=MyLib

And the corresponding optional argument has been added to Ortac/Dune.

Beware that this is not fit to test sub-modules. I plan to cook a sister PR for that before the soon-to-come next release.

@n-osborne n-osborne force-pushed the module-prefix-cli-option branch 2 times, most recently from 465cd9f to 75fdd10 Compare December 18, 2024 16:44
@n-osborne
Copy link
Collaborator Author

CI is green, I'm confident that the code is correct.
But if anyone looking around could take a look at the documentation update, it would be nice.

@n-osborne n-osborne force-pushed the module-prefix-cli-option branch from 75fdd10 to 20004ec Compare December 18, 2024 18:33
@jmid
Copy link
Contributor

jmid commented Dec 18, 2024

CI is green, I'm confident that the code is correct.
But if anyone looking around could take a look at the documentation update, it would be nice.

I had a look and the documentation LGTM (modulo a minor nit) 😃 👍

@n-osborne
Copy link
Collaborator Author

Thanks! Merging now.

@n-osborne n-osborne merged commit 9ef84fc into ocaml-gospel:main Dec 19, 2024
3 checks passed
@n-osborne n-osborne deleted the module-prefix-cli-option branch December 19, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated test file uses wrong module path
2 participants