Using doctest with c++, where can I place initialization code?

43 Views Asked by At

I'm using doctest with DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN defined so that doctest provides its own main function when I run tests. It's been working great this way but now I need to run some setup code that is executed before any of the tests. Where can I put this code? Currently, I have the tests defined in my regular .cpp files and just have the following in doctest.cpp:

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
0

There are 0 best solutions below