I am using gtest
as my testing framework. I am looking for a specific function that will be called only once.
So far, I have seen SetUp
and the constructor of the class. But it seems like they are both called for each test. According to this example, the constructor is where,
You can do set-up work for each test here
leading me to believe that it's called once per test case. For the SetUp
function,
Code here will be called immediately after the constructor (right before each test).
Does that mean both are called for each test? If so, where can I place code that will be called only once for the lifetime of the test class?