Search code examples
c++googletest

google test functions setup() and teardown() is called for each test case or for the whole testsuit


I am using google test and trying to write test fixtures to test source code, in the test fixture, there are several test cases defined.

There are SetUp() and TearDown() functions, for those functions, if there are defined, will they be called for each test case or only once for the whole test suit?


Solution

  • Every test case have it's own fixture, so these are called every time.