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

Run tests with build script #390

Open
tymbaca opened this issue Jan 31, 2025 · 1 comment
Open

Run tests with build script #390

tymbaca opened this issue Jan 31, 2025 · 1 comment

Comments

@tymbaca
Copy link

tymbaca commented Jan 31, 2025

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?

@Vexu
Copy link
Member

Vexu commented Feb 4, 2025

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 Vexu changed the title How to run tests with imports from build.zig? Run tests with build script Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants