I have several unit test cases, which I have written with the Google Test framework:
Test class:
class Test: public testing::Test { public: virtual void SetUp() {} virtual void TearDown() {} };Actual tests:
TEST_F(Test, SubTest1) { // execute Test logic } TEST_F(Test, SubTest2) { // execute Test logic } TEST_F(Test, SubTest3) { // execute Test logic }
Assumed that I want to display only
SubTest1andSubTest3, what do I have to do? Important is, that I want to see at a central place (main method), which tests are actually executed.
I thought, that I can "stack" filters as in the following example, but this approach did not work:
int main(int argc, char** argv)
{
::testing::InitGoogleMock(&argc, argv);
::testing::GTEST_FLAG(filter) = "Test.SubTest1";
::testing::GTEST_FLAG(filter) = "Test.SubTest3";
return RUN_ALL_TESTS();
}
→ The second filter removed the first one and only SubTest3 is executed.