Skip to content

Commit d7325ba

Browse files
committed
Fold the macro google_test_wrapper into google_test.
The separate macro was only needed for some integration tests. That dependency has been removed, so there is no need for a separate macro now. Since the extra macro had to be part of the public API surface, this simplifies the API surface. PiperOrigin-RevId: 497907221
1 parent 416d971 commit d7325ba

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

googletest/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub mod matcher;
2121
#[cfg(not(google3))]
2222
pub mod matchers;
2323

24-
pub use googletest_macro::{google_test, google_test_wrapper};
24+
pub use googletest_macro::google_test;
2525

2626
use internal::test_outcome::TestAssertionFailure;
2727

googletest_macro/src/lib.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,11 @@ use syn::{parse_macro_input, ItemFn};
5252
pub fn google_test(
5353
_args: proc_macro::TokenStream,
5454
input: proc_macro::TokenStream,
55-
) -> proc_macro::TokenStream {
56-
let parsed_fn = parse_macro_input!(input as ItemFn);
57-
let output = quote! {
58-
#[test]
59-
#[googletest::google_test_wrapper]
60-
#parsed_fn
61-
};
62-
output.into()
63-
}
64-
65-
/// Wraps the given function inside an outer function which initialises and
66-
/// queries the `TestOutcome` for the current test.
67-
///
68-
/// This is intended to be used only by the Google Rust test library and its own
69-
/// tests.
70-
#[proc_macro_attribute]
71-
pub fn google_test_wrapper(
72-
_args: proc_macro::TokenStream,
73-
input: proc_macro::TokenStream,
7455
) -> proc_macro::TokenStream {
7556
let parsed_fn = parse_macro_input!(input as ItemFn);
7657
let fn_name = parsed_fn.sig.ident.clone();
7758
let output = quote! {
59+
#[test]
7860
fn #fn_name() -> std::result::Result<(), ()> {
7961
#parsed_fn
8062

0 commit comments

Comments
 (0)