-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
integrate incremental compilation with zig test #4414
Copy link
Copy link
Open
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.incremental compilationProblem occurs only when reusing compiler state.Problem occurs only when reusing compiler state.
Milestone
Metadata
Metadata
Assignees
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.incremental compilationProblem occurs only when reusing compiler state.Problem occurs only when reusing compiler state.
I have a bunch of tests in separate files, and in my
main.zigfile I include all the tests like this:If I update one of these files and run
zig test main.zig, then zig seems to recompile all my tests files even though only one of them changed.My tests run nearly instantly, but they are rather slow to compile:
Running the tests again after they have been compiled:
Removing all the tests from
main.zigexcept for the one that changed:What I expect to happen, is
zig testwould only rebuild the tests that have changed. Of course if I modify code that tests depend upon, then those tests should also be rebuilt. There's not a lot documentation for tests, so I could also have set this up in the completely wrong way.--test-filter
One work around seems to be to use
--test-filter, however this fails because if the filter expression doesn't match againstmain test, then none of the tests will be include or compiled.