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

zig_test test_runner should accept a zig_library #2

Open
gwenzek opened this issue Oct 9, 2024 · 0 comments
Open

zig_test test_runner should accept a zig_library #2

gwenzek opened this issue Oct 9, 2024 · 0 comments

Comments

@gwenzek
Copy link

gwenzek commented Oct 9, 2024

The end goal is to allow zml users to use our async test runner in their project.
Currently test_runner accept a file, but the file is not pulled into the build sandbox.
Also a test_runner.zig may have dependencies (async in our case) so accepting a file is semantically incorrect.

The current workaround consist of declaring test_runner.zig has part of the zml lib ensuring that it is always present in the build sandbox, but it should only appear on when building the test target.

gwenzek added a commit to zml/zml that referenced this issue Oct 9, 2024
The end goal is to allow zml users to use our async test runner in their
project.

This approach works but is a bit hacky because it relies on the fact
that `test_runner.zig` is part of the `zml` library
otherwise `zig_test` doesn't correctly put the test_runner into the
build sandbox.

I made this dependency explicit, but it was already the case because of
the glob pattern used in zml library.

And I think `test_runner` should be `zig_library` in the first place,
and not a filegroup.
See zml/rules_zig#2 for follow up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant