blob: 495f93efd599490e0ac0bdbd4f56f6edde96bc7f [file] [log] [blame]
onqtam4984dd72016-03-20 23:32:15 +02001//#define DOCTEST_DISABLE
hardlyb1e7e142014-08-06 00:43:51 +03002
onqtam4984dd72016-03-20 23:32:15 +02003#define DOCTEST_IMPLEMENT
hardlyb1e7e142014-08-06 00:43:51 +03004#include "doctest.h"
5
6#include <cstdio>
7#include <exception>
8
hardlyb1e7e142014-08-06 00:43:51 +03009static int testWrapper(void (*f)(void)) {
10 try {
11 f();
12 } catch(std::exception& e) {
13 printf("caught the bugger! %s\n", e.what());
14 return 1;
15 }
16 return 0;
17}
18
19int main(int argc, char** argv) {
20 // initialize
21 doctest::Context context(argc, argv);
22 context.setTestExecutionWrapper(testWrapper);
23
24 // overrides
25 context.setOption("dt-case-sensitive", true);
26 context.addFilter("dt-name", "zzz");
27
28 // run
29 int res = context.runTests();
30
31#if defined(WITH_PAUSE)
32 system("pause");
33#endif // _MSC_VER
34
35 return res;
36}