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

Make it easier to use rust_test_suite in macros. #791

Merged
merged 2 commits into from
Jun 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rust/private/rust.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1210,8 +1210,9 @@ def rust_test_suite(name, srcs, **kwargs):
if not src.endswith(".rs"):
fail("srcs should have `.rs` extensions")

# Prefixed with `name` to allow parameterization with macros
# The test name should not end with `.rs`
test_name = src[:-3]
test_name = name + "_" + src[:-3]
rust_test(
name = test_name,
crate_name = test_name.replace("/", "_"),
Expand Down