blob: af44367b7c7f4dc33ff1b5456fda79ac71d0fc4f [file] [log] [blame]
onqtama985f5a2017-04-16 22:48:07 +03001#include "parts/doctest_impl.h"
2
3int main(int argc, char** argv) {
4 doctest::Context context;
5
6 // !!! THIS IS JUST AN EXAMPLE SHOWING HOW DEFAULTS/OVERRIDES ARE SET !!!
7
8 // defaults
9 context.addFilter("test-case-exclude", "*math*"); // exclude test cases with "math" in the name
10 context.setOption("no-breaks", true); // don't break in the debugger when assertions fail
11
12 context.applyCommandLine(argc, argv);
13
14 // overrides
onqtam35c14cd2017-04-24 12:54:03 +030015 context.setOption("order-by", "file"); // sort the test cases by their name
onqtama985f5a2017-04-16 22:48:07 +030016
17 int res = context.run(); // run
18
19 if(context.shouldExit()) // important - query flags (and --exit) rely on the user doing this
20 return res; // propagate the result of the tests
21
22 int client_stuff_return_code = 0;
23 // your program - if the testing framework is integrated in your production code
24
25#ifdef WITH_PAUSE
26 system("pause");
27#endif // WITH_PAUSE
28
29 return res + client_stuff_return_code; // the result from doctest is propagated here as well
30}