1

In gtest main, when using

int main(int argc, char **argv)
{
    printf("Running tests\n");
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();

}

It always run all the tests.

Is there a way to run some specific tests?

Adam Lee
  • 24,710
  • 51
  • 156
  • 236

1 Answers1

1

First, you don't need to write a main() for gtest. You can just link with gtest_main library as well as gtest library. It is pretty similar to what you have, though.

Second, to run a specific test, please refer to advanced options.

Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
xosp7tom
  • 2,131
  • 1
  • 17
  • 26