-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_runner.cpp
More file actions
25 lines (18 loc) · 789 Bytes
/
test_runner.cpp
File metadata and controls
25 lines (18 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#define DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
#define DOCTEST_CONFIG_IMPLEMENT
#include "tests/doctest.h"
int main(int argc, char** argv) {
doctest::Context context(argc, argv);
context.setOption("abort-after",
1); // stop test execution after 1 failed assertion
context.setOption("no-breaks",
true); // don't break in the debugger when assertions fail
int test_result = context.run(); // run queries, or run tests unless --no-run
// --- Comment lines below when running tests locally ---
if (test_result == 1)
throw std::runtime_error("Test failed");
// --- Comment lines above when running tests locally ---
if (context.shouldExit()) // honor query flags and --exit
return test_result;
return test_result;
}