Skip to content

WIP: extract and test a Mirage_cli module#928

Closed
emillon wants to merge 8 commits intomirage:masterfrom
emillon:mirage-cli-tests
Closed

WIP: extract and test a Mirage_cli module#928
emillon wants to merge 8 commits intomirage:masterfrom
emillon:mirage-cli-tests

Conversation

@emillon
Copy link
Copy Markdown
Contributor

@emillon emillon commented Oct 5, 2018

Hello!

While trying to understand how this package works, I noticed that the Mirage module does a lot of things. I'd like to make it a bit more modular, in particular to test some internals.

This PR adds some characterization tests - just a way to dump the existing behavior so that we know about how these work and we can touch them without fear of breaking things. When/if this becomes possible, they can be replaced by lower level tests.

I have some questions:

  • Is a global Mirage_cli module OK, or should it be a bit more hidden (like Mirage.Private_cli or under Mirage.Codegen?)
  • At the moment it only deals with generating files, so maybe Mirage_codegen is more appropriate?

Thanks!

@samoht
Copy link
Copy Markdown
Member

samoht commented Oct 5, 2018

As all your functions are named output_* maybe Mirage_ouput is indeed better. And you can drop the function prefix then.

@emillon
Copy link
Copy Markdown
Contributor Author

emillon commented Oct 5, 2018

How would Mirage_files.* look? e.g. Mirage_files.main_xl.

@Drup
Copy link
Copy Markdown
Member

Drup commented Oct 6, 2018

I'm not convinced those are a great target for lifting them out but why not. You could make the code far less horrifying by just using {|....|}. I do appreciate you added all these tests though!

@samoht
Copy link
Copy Markdown
Member

samoht commented Mar 6, 2020

I'm closing this PR as it started to bit-rot. I like the general approach of having a better way to test the generated code, but as #933 has been merged, I think we should move all of these functions as top-level of their modules to ease testing. Will follow-up with new PRs.

@samoht samoht closed this Mar 6, 2020
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