//#define DOCTEST_DISABLE | |
#define DOCTEST_IMPLEMENT | |
#include "doctest.h" | |
#include <cstdio> | |
#include <exception> | |
static int testWrapper(void (*f)(void)) { | |
try { | |
f(); | |
} catch(std::exception& e) { | |
printf("caught the bugger! %s\n", e.what()); | |
return 1; | |
} | |
return 0; | |
} | |
int main(int argc, char** argv) { | |
// initialize | |
doctest::Context context(argc, argv); | |
context.setTestExecutionWrapper(testWrapper); | |
// overrides | |
context.setOption("dt-case-sensitive", true); | |
context.addFilter("dt-name", "zzz"); | |
// run | |
int res = context.runTests(); | |
#if defined(WITH_PAUSE) | |
system("pause"); | |
#endif // _MSC_VER | |
return res; | |
} |