| 4 | #include "doctest.cpp" |
| 5 | |
| 6 | int main(int argc, char** argv) |
| 7 | { |
| 8 | doctest::Context context; |
| 9 | // !!! THIS IS JUST AN EXAMPLE SHOWING HOW DEFAULTS/OVERRIDES ARE SET !!! |
| 10 | |
| 11 | // defaults |
| 12 | // context.addFilter("test-case-exclude", "*math*"); // exclude test cases with "math" in their name |
| 13 | // context.setOption("abort-after", 5); // stop test execution after 5 failed assertions |
| 14 | // context.setOption("order-by", "name"); // sort the test cases by their name |
| 15 | |
| 16 | context.applyCommandLine(argc, argv); |
| 17 | |
| 18 | // overrides |
| 19 | // context.setOption("no-breaks", true); // don't break in the debugger when assertions fail |
| 20 | |
| 21 | int res = context.run(); // run |
| 22 | |
| 23 | if(context.shouldExit()) // important - query flags (and --exit) rely on the user doing this |
| 24 | return res; // propagate the result of the tests |
| 25 | |
| 26 | int client_stuff_return_code = 0; |
| 27 | // your program - if the testing framework is integrated in your production code |
| 28 | |
| 29 | return res + client_stuff_return_code; // the result from doctest is propagated here as well |
| 30 | } |
nothing calls this directly
no test coverage detected