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

Adapt Python generator to Roc #6

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Conversation

ageron
Copy link
Contributor

@ageron ageron commented Aug 23, 2024

I copied Python's bin/generate_tests.py script and its dependencies (bin/data.py, config/generator_macros.j2, and requirements-generator.txt), and I adapted it to Roc.

To use:

  • Create a .meta/template.j2 file.
  • Run bin/generate_tests.py

This will generate the <slug>-test.roc file for each exercise. See bin/generate_tests.py --help for more options.

I also added a template.j2 file for the two existing exercises (hello-world and leap) and regenerated the test scripts.

Now that we have a roc-test-runner and generator script, and a couple working exercises, we can start adding new exercises quickly! 😊

Copy link

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Great idea

@ageron ageron merged commit c029401 into exercism:main Aug 23, 2024
1 check passed
@ageron
Copy link
Contributor Author

ageron commented Aug 23, 2024

Thanks Erik ☺️

@ageron ageron deleted the add-generator branch August 23, 2024 20:35
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.

2 participants