Rework and cleanup core implementation
Closed this issue · 0 comments
tingerrr commented
The current implementation is a little brittle, this has a lot of downsides:
- error reporting is sometimes done using
?
, other times it's swallowed and simply printed to stdout - some actually likely error cases are not properly handled and result in a simple error message with no hint
- as it currently is, reporting a nonzero exit code on test failure would need an ugly hack
- this is currently the primary blocker for adoption of typst-test in cetz and in code bases which test using CI in general
The core should be reworked into a solid foundation on which new features can be built. At this stage, the project is still fairly small, and a rewrite is feasible.
I want to achieve the following goals with the rewrite:
- Abstract user facing reporting sufficiently to allow in place progress per test for multiple tests
- Properly handle common error cases better
- Make code easier to follow and reason about
- Make code, which depends on FS operations, easier to test automatically
- Abstract the testing in a way that makes separation into a core library and cli frontend easier down the line