Skip to content

Commit

Permalink
Make it easier to use rust_test_suite in macros. (#791)
Browse files Browse the repository at this point in the history
* Make it easier to use rust_test_suite in macros.

* Separate with underscore.
  • Loading branch information
sayrer committed Jun 24, 2021
1 parent 11551b1 commit 8cb0c78
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 8cb0c78

Please sign in to comment.