vscode-zig icon indicating copy to clipboard operation
vscode-zig copied to clipboard

Run tests with build script

Open tymbaca opened this issue 11 months ago • 1 comments

I want to run tests. But I get this error:

Users/tymbaca/code/zig/aoc/aoc2024/src/day3/main.zig:2:21: error: no module named 'lib' available within module test

I have "lib" import in my build.zig. How can I make so the extension will use build.zig to run that tests?

tymbaca avatar Jan 31 '25 16:01 tymbaca

There is currently no way to do that.

It could be implemented similar to the main CodeLens by checking for a build.zig file and calling zig build test-unit -Dtest-filter=<filter>. A test-unit step and a test-filter option aren't standard conventions currently but if this feature was implemented they could be made to be.

Vexu avatar Feb 04 '25 14:02 Vexu