Skip to content

Add a command that generates test code#305

Merged
NathanReb merged 3 commits intorealworldocaml:masterfrom
voodoos:dune-gen
May 12, 2021
Merged

Add a command that generates test code#305
NathanReb merged 3 commits intorealworldocaml:masterfrom
voodoos:dune-gen

Conversation

@voodoos
Copy link
Copy Markdown
Collaborator

@voodoos voodoos commented Nov 18, 2020

This PR is part of the implementation of the new Dune's mdx stanza.
The design document can be found here.
The corresponding Dune's PR is here.

This is a rough first attempt to generate a test executable, but it already works for most cases.
The main missing feature is the ability to pass a list of directories containing cm* files to the generator.

I made a subcommand for now, but a separate binary might be a better choice ?

@voodoos voodoos mentioned this pull request Nov 18, 2020
5 tasks
Copy link
Copy Markdown
Contributor

@gpetiot gpetiot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, thanks! I only had a look at this part and not the full dune integration

@voodoos voodoos marked this pull request as ready for review April 19, 2021 15:47
@voodoos voodoos requested a review from gpetiot May 7, 2021 12:52
Copy link
Copy Markdown
Contributor

@gpetiot gpetiot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@voodoos
Copy link
Copy Markdown
Collaborator Author

voodoos commented May 7, 2021

@gpetiot I just realised that I changed the interface of Mdx_test :

b1a229c#diff-5da8e8cd516e18aa55b7f95da3437cee754d51f6d9bdf3439fca45fa3b6b67baL33-R33

Is that ok ?

@gpetiot
Copy link
Copy Markdown
Contributor

gpetiot commented May 7, 2021

It looks fine to me, not sure many people use mdx as a library anyway, I will let @NathanReb merge in case he doesn't agree

@gpetiot gpetiot requested a review from NathanReb May 7, 2021 21:29
Copy link
Copy Markdown
Contributor

@NathanReb NathanReb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all looks good to me! Have you had a chance to test it with your dune patch, I'm guessing it all works fine but I'd rather be sure before merging!

I just realised that I changed the interface of Mdx_test

It's fine, nobody should be using it anyway. The only consumer of the library atm is RWO and I don't think it uses this part of the API at all anyway. In the future we'll probably migrate RWO's code to use OMD instead as it mostly relies on MDX for markdown parsing and to generate the right html.

@voodoos
Copy link
Copy Markdown
Collaborator Author

voodoos commented May 12, 2021

It all looks good to me! Have you had a chance to test it with your dune patch, I'm guessing it all works fine but I'd rather be sure before merging!

Yes I did !

@NathanReb
Copy link
Copy Markdown
Contributor

Awesome possum! Let's merge!

@NathanReb NathanReb merged commit 204aea9 into realworldocaml:master May 12, 2021
NathanReb added a commit to NathanReb/opam-repository that referenced this pull request Jun 2, 2021
CHANGES:

#### Added

- Add a new `dune-gen` subcommand that generates testing code for Dune to build
  and run with the new `mdx` stanza. (realworldocaml/mdx#305, @voodoos)
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.

3 participants