-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify a Gtest factory by its typename, and give access to a wrapper
The gtest macro takes as arguments the C++ typename of the TestSuite to create (which must have a RUST_GTEST_TEST_SUITE_FACTORY() macro somewhere that will be linked in with the test) and a Rust type which must be an FFI wrapper around the C++ type. In particular it must be valid to cast from a pointer to the C++ type into a pointer to the Rust type. Since the Rust type is an FFI wrapper and defined by the test file (or some other crate), it can also expose methods that call through to the C++ TestSuite class. R=lukasza@chromium.org Bug: 1305396 Change-Id: I2ddbfbd99d5fb005a22f822a441b9690544dab49 Cq-Include-Trybots: luci.chromium.try:android-rust-arm-dbg,android-rust-arm-rel,linux-rust-x64-dbg,linux-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561744 Commit-Queue: danakj <danakj@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/main@{#1002837}
- Loading branch information
Showing
11 changed files
with
420 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.