clstaudt
clstaudt

Reputation: 22488

googletest: is it possible to select a single test fixture/case?

I use googletest for C++ unit testing. I have defined multiple classes deriving from ::testing::Test, each of which has multiple test functions defined with TEST_F.

I run them all with

int main(int argc, char **argv) {

    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();

}

When debugging, I'd like to focus on a specific test case. Is it possible to run only a specific Test or TEST_F?

Upvotes: 1

Views: 3657

Answers (1)

Nicoretti
Nicoretti

Reputation: 1147

you can use the gtests command line option --gtest_filter wehen invoking the executable for the debugging session. @see Running a Subset of the Tests

Upvotes: 3

Related Questions