rust_gtest_interop 库
The rust_gtest_interop library provides a way to:
- Use a Rust function as a
gtesttestcase (using the#[gtest(...)]attribute) - Use
expect_eq!and similar macros (similar toassert_eq!but not panicking and not terminating the test when the assertion fails).
Example:
use rust_gtest_interop::prelude::*;#[gtest(MyRustTestSuite, MyAdditionTest)]fn test_addition() {expect_eq!(2 + 2, 4);}