Attention is currently required from: John Chen.
1 comment:
Patchset:
Hi John, what do you think of doing this?
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: John Chen.
danakj uploaded patch set #2 to this change.
Add //testing/rust_gtest_interop when //testing/gtest is in deps
To make it simpler to add rust files to a unit test, act as if Rust
interop support is build into //testing/gtest. Then a person only needs
to add `rs_sources = [ "foo.rs" ]` to their test() target (as well as a
`rs_crate_root` for now), and their rust files will automatically get
the Rust gtest macros and run as part of their gtest binary.
We add //testing/rust_gtest_interop to rs_deps only if:
1. The target already depends on //testing/gtest, since otherwise it
would not work.
2. The target defines a non-empty rs_sources; that is, they have Rust
unit tests in the test() target.
R=john...@chromium.org
Bug: 1293979
Change-Id: Ia18d2dc89661ada05b6d96d15b5f2906a733f621
Cq-Include-Trybots: luci.chromium.try:android-rust-arm-rel,linux-rust-x64-rel
---
M testing/rust_gtest_interop/BUILD.gn
M testing/test.gni
2 files changed, 79 insertions(+), 16 deletions(-)
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: danakj, Ben Pastene.
John Chen would like Ben Pastene to review this change authored by danakj.
Attention is currently required from: danakj, Ben Pastene.
1 comment:
Patchset:
Ben: Could you PTAL?
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: danakj.
1 comment:
Patchset:
I haven't any knowledge or prior context with rust, so pardon the clarifying questions, but as I've tried understanding it:
Is that right? And this is all so that they don't have to add one extra line like `deps += [ "//testing/rust_gtest_interop" ]` to their test target?
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Ben Pastene.
1 comment:
Patchset:
I haven't any knowledge or prior context with rust, so pardon the clarifying questions, but as I've […]
Yes. That's all correct except (nit) it would be `rs_deps += ["//testing/rust_gtest_interop"]`
A README is a good idea. There's a long comment in gtest_attribute.rs I can steal from. I can add the README in this CL.
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: danakj, John Chen.
Patch set 4:Code-Review +1
1 comment:
Patchset:
Yes. That's all correct except (nit) it would be `rs_deps += ["//testing/rust_gtest_interop"]` […]
I think the introspection of the deps is a bit funky, but I've seen far funkier stuff in chromium's GN. And I can appreciate why yall would want to make rust integration as easy as possible, so lgtm. (And thx for the readme)
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: John Chen.
Patch set 4:Commit-Queue +2
1 comment:
Patchset:
Cool, thanks for reviewing!
To view, visit change 3497966. To unsubscribe, or for help writing mail filters, visit settings.
Chromium LUCI CQ submitted this change.
Add //testing/rust_gtest_interop when //testing/gtest is in deps
To make it simpler to add rust files to a unit test, act as if Rust
interop support is build into //testing/gtest. Then a person only needs
to add `rs_sources = [ "foo.rs" ]` to their test() target (as well as a
`rs_crate_root` for now), and their rust files will automatically get
the Rust gtest macros and run as part of their gtest binary.
We add //testing/rust_gtest_interop to rs_deps only if:
1. The target already depends on //testing/gtest, since otherwise it
would not work.
2. The target defines a non-empty rs_sources; that is, they have Rust
unit tests in the test() target.
R=john...@chromium.org
Bug: 1293979
Change-Id: Ia18d2dc89661ada05b6d96d15b5f2906a733f621
Cq-Include-Trybots: luci.chromium.try:android-rust-arm-rel,linux-rust-x64-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3497966
Reviewed-by: Ben Pastene <bpas...@chromium.org>
Commit-Queue: danakj <dan...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#977827}
---
M testing/rust_gtest_interop/BUILD.gn
A testing/rust_gtest_interop/README.md
M testing/test.gni
3 files changed, 216 insertions(+), 16 deletions(-)