blob: d6ae838e01efe7b24e4345e4dde647b5ac59e631 [file] [log] [blame]
onqtam4a655632016-05-26 14:20:52 +03001#define DOCTEST_CONFIG_DISABLE
2
3#define DOCTEST_CONFIG_IMPLEMENT
4#include "doctest.h"
5
6int main(int argc, char** argv) {
onqtam7d5c0d52016-06-02 17:50:59 +03007 doctest::Context context; // initialize
8
9 // defaults
10 context.addFilter("test-case-exclude", "*math*"); // exclude test cases with "math" in the name
11 context.setOption("no-breaks", true); // don't break in the debugger when assertions fail
12
13 context.applyCommandLine(argc, argv);
onqtam4a655632016-05-26 14:20:52 +030014
15 // overrides
onqtam7d5c0d52016-06-02 17:50:59 +030016 context.setOption("abort-after", 5); // stop test execution after 5 failed assertions
17 context.setOption("sort", "name"); // sort the test cases by their name
onqtam4a655632016-05-26 14:20:52 +030018
19 int res = context.run(); // run
20
onqtamf720d432016-05-31 17:51:10 +030021 if(context.shouldExit()) // important - query flags (and --exit) rely on the user doing this
onqtam4a655632016-05-26 14:20:52 +030022 return res; // propagate the result of the tests
23
24 int client_stuff_return_code = 0;
25 // your program - if the testing framework is integrated in your production code
26
onqtam96bdf712016-09-13 16:45:52 +030027 return res + client_stuff_return_code; // the result from doctest is propagated here as well
onqtam4a655632016-05-26 14:20:52 +030028}