sophiajt / june

MIT License
803 stars 31 forks source link

Reduce boiler plate for integration tests #49

Closed yaahc closed 6 months ago

yaahc commented 6 months ago

Prior to this PR, adding a new test entailed adding the files to the tests/integration directory and then editing tests/integration_tests.rs to manually setup a test harness mentioning that file path explicitly.

This PR changes integration_tests.rs to find the tests automatically, using libtest_mimic to preserve consistent output. It now walks the directory tree looking for valid june files and treats each file as a test case. Adding a new test now only involves adding the file to the integration tests directory as before, and making sure that there's a test configuration comment at the top of the file e.g. // output: ... or // error: ... and that's it.