Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

googletest: add TYPED_TEST macros #7071

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cfg/googletest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<define name="TEST(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TEST_F(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TEST_P(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TYPED_TEST(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TYPED_TEST_P(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="GTEST_API_" value=""/>
<define name="GTEST_FLAG(name)" value="FLAGS_gtest_##name"/>
<define name="GTEST_DECLARE_bool_(name)" value="GTEST_API_ extern bool GTEST_FLAG(name)"/>
Expand Down
10 changes: 10 additions & 0 deletions test/cfg/googletest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ namespace ExampleNamespace {
{
return (arg == TOLERANCE);
}

// syntaxError when TYPED_TEST is not known
TYPED_TEST (ExampleTypedTest, cppcheck_test)
{
}

// syntaxError when TYPED_TEST_P is not known
TYPED_TEST_P (ExampleTypedTestP, cppcheck)
{
}
}

TEST(ASSERT, ASSERT)
Expand Down
Loading