added an overload for operator<< of the ContextBuilder that catches by const ref and use a static assert - relates #23
Added option to show duration of test case execution and added a timeout(seconds) decorator - marking them as failed if they exceed it - closes #68 - closes #67
diff --git a/doc/markdown/roadmap.md b/doc/markdown/roadmap.md
index 73872d8..17608ce 100644
--- a/doc/markdown/roadmap.md
+++ b/doc/markdown/roadmap.md
@@ -10,28 +10,7 @@
### For 1.2:
-- decorators
- - test_suite
- - description
- - skip
- - may_fail - doesn't fail the test if any given assertion fails (but still reports it). This can be useful to flag a work-in-progress, or a known issue that you don't want to immediately fix but still want to track in the your tests.
- - should_fail - like [!mayfail] but fails the test if it passes. This can be useful if you want to be notified of accidental, or third-party, fixes.
- - expected_failures
-- time stuff
- - reporting running time of tests
- - timeout (decorator)
- - count a test case as failed if it exceeds X ms (but no force-killing!)
- Entering test module "decorator_08"
- test.cpp(6): Entering test case "test1"
- test.cpp(6): Leaving test case "test1"; testing time: 1ms
- test.cpp(11): Entering test case "test2"
- test.cpp(13): error: in "test2": check false has failed
- test.cpp(11): Leaving test case "test2"; testing time: 2ms
- test.cpp(39): Entering test case "test3"
- test.cpp(41): error: in "test3": check false has failed
- test.cpp(39): Leaving test case "test3"; testing time: 2ms
- test.cpp(45): Test case "test4" is skipped because test2 and test3 failed
- Leaving test module "decorator_08"; testing time: 16ms
+- remove DOCTEST_CONFIG_WITH_LONG_LONG
- runtime performance
- move string implementation to the fwd part - use new/delete
- lazily stringify expressions - only when needed
@@ -58,6 +37,13 @@
- write about static code analysis
- docs about sort-of data driven testing - with INFO and SUBCASE
- docs about decorators
+ - test_suite
+ - description
+ - skip
+ - may_fail - doesn't fail the test if any given assertion fails (but still reports it). This can be useful to flag a work-in-progress, or a known issue that you don't want to immediately fix but still want to track in the your tests.
+ - should_fail - like [!mayfail] but fails the test if it passes. This can be useful if you want to be notified of accidental, or third-party, fixes.
+ - expected_failures
+ - timeout
- https://www.paypal.me/onqtam
- https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/sanitization_filter.rb#L45-L48
- add a new page for build systems and integration
@@ -144,8 +130,11 @@
- thread safety - asserts/subcases/captures should be safe to be used by multiple threads simultaneously
- support for running tests in parallel in multiple threads
- death tests - as in [google test](https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#death-tests)
-- command line
+- config options
+ - test case name uniqueness - reject the ones with identical names
+- command line options
- ability to specify ASC/DESC for the order option
+ - global timeout option (per test or per entire session?)
- command line error handling/reporting
- ability for the user to extend the command line - as requested [here](https://github.com/philsquared/Catch/issues/622)
- option to list files in which there are test cases who match the current filters
diff --git a/doctest/doctest.h b/doctest/doctest.h
index 69d41b0..2dbfbfc 100644
--- a/doctest/doctest.h
+++ b/doctest/doctest.h
@@ -28,6 +28,7 @@
// - colors in the console
// - breaking into a debugger
// - signal / SEH handling
+// - timer
//
// The expression decomposing templates are taken from lest - https://github.com/martinmoene/lest
// which uses the Boost Software License - Version 1.0
@@ -61,6 +62,7 @@
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#pragma clang diagnostic ignored "-Wunused-local-typedef"
+#pragma clang diagnostic ignored "-Wc++11-long-long"
#endif // __clang__
#if defined(__GNUC__) && !defined(__clang__)
@@ -75,6 +77,7 @@
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#pragma GCC diagnostic ignored "-Winline"
+#pragma GCC diagnostic ignored "-Wlong-long"
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif // > gcc 4.6
@@ -477,6 +480,7 @@
bool m_may_fail;
bool m_should_fail;
int m_expected_failures;
+ double m_timeout;
TestSuite& operator*(const char* in) {
m_test_suite = in;
@@ -486,6 +490,7 @@
m_may_fail = false;
m_should_fail = false;
m_expected_failures = 0;
+ m_timeout = 0;
return *this;
}
@@ -1394,6 +1399,7 @@
bool m_may_fail;
bool m_should_fail;
int m_expected_failures;
+ double m_timeout;
// fields by which uniqueness of test cases shall be determined
const char* m_file; // the file in which the test was registered
@@ -1865,6 +1871,15 @@
void fill(detail::TestSuite& state) const { state.m_skip = data; }
};
+struct timeout
+{
+ double data;
+ timeout(double in)
+ : data(in) {}
+ void fill(detail::TestCase& state) const { state.m_timeout = data; }
+ void fill(detail::TestSuite& state) const { state.m_timeout = data; }
+};
+
struct may_fail
{
bool data;
@@ -3053,6 +3068,7 @@
#pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
#pragma clang diagnostic ignored "-Wmissing-braces"
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
+#pragma clang diagnostic ignored "-Wc++11-long-long"
#endif // __clang__
#if defined(__GNUC__) && !defined(__clang__)
@@ -3072,6 +3088,7 @@
#pragma GCC diagnostic ignored "-Wswitch-enum"
#pragma GCC diagnostic ignored "-Wswitch-default"
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+#pragma GCC diagnostic ignored "-Wlong-long"
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif // > gcc 4.6
@@ -3145,6 +3162,10 @@
#include <exception>
#include <stdexcept>
#include <csignal>
+#include <cfloat>
+#ifndef _MSC_VER
+#include <stdint.h>
+#endif // _MSC_VER
namespace doctest
{
@@ -3253,6 +3274,7 @@
bool success; // include successful assertions in output
bool case_sensitive; // if filtering should be case sensitive
bool exit; // if the program should be exited after the tests are ran/whatever
+ bool duration; // print the time duration of each test case
bool no_exitcode; // if the framework should return 0 as the exitcode
bool no_run; // to not run the tests at all (can be done with an "*" exclude)
bool no_version; // to not print the version of the framework
@@ -3554,6 +3576,10 @@
#endif
#include <io.h>
+#else // _WIN32
+
+#include <sys/time.h>
+
#endif // _WIN32
namespace doctest_detail_test_suite_ns
@@ -3581,6 +3607,7 @@
, m_may_fail(test_suite.m_may_fail)
, m_should_fail(test_suite.m_should_fail)
, m_expected_failures(test_suite.m_expected_failures)
+ , m_timeout(test_suite.m_timeout)
, m_file(file)
, m_line(line)
, m_template_id(template_id) {}
@@ -3607,6 +3634,7 @@
m_may_fail = other.m_may_fail;
m_should_fail = other.m_should_fail;
m_expected_failures = other.m_expected_failures;
+ m_timeout = other.m_timeout;
m_file = other.m_file;
m_line = other.m_line;
m_template_id = other.m_template_id;
@@ -3791,6 +3819,46 @@
return false;
}
+ typedef unsigned long long UInt64;
+
+#ifdef _WIN32
+
+ UInt64 getCurrentTicks() {
+ static UInt64 hz = 0, hzo = 0;
+ if(!hz) {
+ QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER*>(&hz));
+ QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&hzo));
+ }
+ UInt64 t;
+ QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&t));
+ return ((t - hzo) * 1000000) / hz;
+ }
+#else // _WIN32
+ UInt64 getCurrentTicks() {
+ timeval t;
+ gettimeofday(&t, 0);
+ return static_cast<UInt64>(t.tv_sec) * 1000000ull + static_cast<UInt64>(t.tv_usec);
+ }
+#endif // _WIN32
+
+ class Timer
+ {
+ public:
+ Timer()
+ : m_ticks(0) {}
+ void start() { m_ticks = getCurrentTicks(); }
+ unsigned int getElapsedMicroseconds() const {
+ return static_cast<unsigned int>(getCurrentTicks() - m_ticks);
+ }
+ unsigned int getElapsedMilliseconds() const {
+ return static_cast<unsigned int>(getElapsedMicroseconds() / 1000);
+ }
+ double getElapsedSeconds() const { return getElapsedMicroseconds() / 1000000.0; }
+
+ private:
+ UInt64 m_ticks;
+ };
+
// the current ContextState with which tests are being executed
ContextState*& getContextState() {
static ContextState* data = 0;
@@ -4878,7 +4946,7 @@
std::printf(" -c, --count prints the number of matching tests\n");
std::printf(" -ltc, --list-test-cases lists all matching tests by name\n");
std::printf(" -lts, --list-test-suites lists all matching test suites\n\n");
- // ==================================================================================== << 79
+ // ========================================================================================= << 79
DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
std::printf("The available <int>/<string> options/filters are:\n\n");
std::printf(" -tc, --test-case=<filters> filters tests by their name\n");
@@ -4903,6 +4971,7 @@
std::printf(" -s, --success=<bool> include successful assertions in output\n");
std::printf(" -cs, --case-sensitive=<bool> filters being treated as case sensitive\n");
std::printf(" -e, --exit=<bool> exits after the tests finish\n");
+ std::printf(" -d, --duration=<bool> prints the time duration of each test\n");
std::printf(" -nt, --no-throw=<bool> skips exceptions-related assert checks\n");
std::printf(" -ne, --no-exitcode=<bool> returns (or exits) always with success\n");
std::printf(" -nr, --no-run=<bool> skips all runtime doctest operations\n");
@@ -4913,7 +4982,7 @@
std::printf(" -ns, --no-skip=<bool> don't skip test cases marked as skip\n");
std::printf(" -npf, --no-path-filenames=<bool> only filenames and no paths in output\n");
std::printf(" -nln, --no-line-numbers=<bool> 0 instead of real line numbers in output\n");
- // ==================================================================================== << 79
+ // ========================================================================================= << 79
// clang-format on
DOCTEST_PRINTF_COLORED("\n[doctest] ", Color::Cyan);
@@ -4942,12 +5011,12 @@
DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "test cases: %4u",
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "test cases: %6u",
p->numTestsPassingFilters);
DOCTEST_PRINTF_COLORED(buff, Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d passed",
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d passed",
p->numTestsPassingFilters - p->numFailed);
DOCTEST_PRINTF_COLORED(buff,
(p->numTestsPassingFilters == 0 || anythingFailed) ?
@@ -4955,7 +5024,7 @@
Color::Green);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4u failed", p->numFailed);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6u failed", p->numFailed);
DOCTEST_PRINTF_COLORED(buff, p->numFailed > 0 ? Color::Red : Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
@@ -4963,24 +5032,24 @@
if(p->no_skipped_summary == false) {
int numSkipped = static_cast<unsigned>(getRegisteredTests().size()) -
p->numTestsPassingFilters;
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d skipped", numSkipped);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d skipped", numSkipped);
DOCTEST_PRINTF_COLORED(buff, numSkipped == 0 ? Color::None : Color::Yellow);
}
DOCTEST_PRINTF_COLORED("\n", Color::None);
DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "assertions: %4d", p->numAssertions);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "assertions: %6d", p->numAssertions);
DOCTEST_PRINTF_COLORED(buff, Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d passed",
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d passed",
p->numAssertions - p->numFailedAssertions);
DOCTEST_PRINTF_COLORED(
buff, (p->numAssertions == 0 || anythingFailed) ? Color::None : Color::Green);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d failed", p->numFailedAssertions);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d failed", p->numFailedAssertions);
DOCTEST_PRINTF_COLORED(buff, p->numFailedAssertions > 0 ? Color::Red : Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " |\n");
@@ -5069,6 +5138,7 @@
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-success, dt-s, success, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-case-sensitive, dt-cs, case_sensitive, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-exit, dt-e, exit, false);
+ DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-duration, dt-d, duration, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-throw, dt-nt, no_throw, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-exitcode, dt-ne, no_exitcode, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-run, dt-nr, no_run, false);
@@ -5265,6 +5335,9 @@
p->hasLoggedCurrentTestStart = false;
p->numFailedAssertionsForCurrentTestcase = 0;
p->subcasesPassed.clear();
+ double duration = 0;
+ Timer timer;
+ timer.start();
do {
// if the start has been logged from a previous iteration of this loop
if(p->hasLoggedCurrentTestStart)
@@ -5314,6 +5387,26 @@
} while(p->subcasesHasSkipped == true);
+ duration = timer.getElapsedSeconds();
+
+ if(Approx(p->currentTest->m_timeout).epsilon(DBL_EPSILON) != 0 &&
+ Approx(duration).epsilon(DBL_EPSILON) > p->currentTest->m_timeout) {
+ failed = true;
+ DOCTEST_LOG_START();
+ char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+ DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg),
+ "Test case exceeded time limit of %.6f!\n",
+ p->currentTest->m_timeout);
+ DOCTEST_PRINTF_COLORED(msg, Color::Red);
+ }
+
+ if(p->duration) {
+ char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+ DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), "%.6f s: %s\n", duration,
+ p->currentTest->m_name);
+ DOCTEST_PRINTF_COLORED(msg, Color::None);
+ }
+
if(data.m_should_fail) {
DOCTEST_LOG_START();
if(!failed) {
@@ -5335,9 +5428,10 @@
char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
if(p->numFailedAssertionsForCurrentTestcase == data.m_expected_failures) {
failed = false;
- DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg),
- "Failed exactly %d times as expected so marking it as not failed!\n",
- data.m_expected_failures);
+ DOCTEST_SNPRINTF(
+ msg, DOCTEST_COUNTOF(msg),
+ "Failed exactly %d times as expected so marking it as not failed!\n",
+ data.m_expected_failures);
DOCTEST_PRINTF_COLORED(msg, Color::Yellow);
} else {
failed = true;
diff --git a/doctest/parts/doctest_fwd.h b/doctest/parts/doctest_fwd.h
index bc630ea..0ba044b 100644
--- a/doctest/parts/doctest_fwd.h
+++ b/doctest/parts/doctest_fwd.h
@@ -25,6 +25,7 @@
// - colors in the console
// - breaking into a debugger
// - signal / SEH handling
+// - timer
//
// The expression decomposing templates are taken from lest - https://github.com/martinmoene/lest
// which uses the Boost Software License - Version 1.0
@@ -58,6 +59,7 @@
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#pragma clang diagnostic ignored "-Wunused-local-typedef"
+#pragma clang diagnostic ignored "-Wc++11-long-long"
#endif // __clang__
#if defined(__GNUC__) && !defined(__clang__)
@@ -72,6 +74,7 @@
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
#pragma GCC diagnostic ignored "-Winline"
+#pragma GCC diagnostic ignored "-Wlong-long"
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif // > gcc 4.6
@@ -474,6 +477,7 @@
bool m_may_fail;
bool m_should_fail;
int m_expected_failures;
+ double m_timeout;
TestSuite& operator*(const char* in) {
m_test_suite = in;
@@ -483,6 +487,7 @@
m_may_fail = false;
m_should_fail = false;
m_expected_failures = 0;
+ m_timeout = 0;
return *this;
}
@@ -1391,6 +1396,7 @@
bool m_may_fail;
bool m_should_fail;
int m_expected_failures;
+ double m_timeout;
// fields by which uniqueness of test cases shall be determined
const char* m_file; // the file in which the test was registered
@@ -1862,6 +1868,15 @@
void fill(detail::TestSuite& state) const { state.m_skip = data; }
};
+struct timeout
+{
+ double data;
+ timeout(double in)
+ : data(in) {}
+ void fill(detail::TestCase& state) const { state.m_timeout = data; }
+ void fill(detail::TestSuite& state) const { state.m_timeout = data; }
+};
+
struct may_fail
{
bool data;
diff --git a/doctest/parts/doctest_impl.h b/doctest/parts/doctest_impl.h
index 00a7855..c138075 100644
--- a/doctest/parts/doctest_impl.h
+++ b/doctest/parts/doctest_impl.h
@@ -16,6 +16,7 @@
#pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
#pragma clang diagnostic ignored "-Wmissing-braces"
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
+#pragma clang diagnostic ignored "-Wc++11-long-long"
#endif // __clang__
#if defined(__GNUC__) && !defined(__clang__)
@@ -35,6 +36,7 @@
#pragma GCC diagnostic ignored "-Wswitch-enum"
#pragma GCC diagnostic ignored "-Wswitch-default"
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+#pragma GCC diagnostic ignored "-Wlong-long"
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif // > gcc 4.6
@@ -108,6 +110,10 @@
#include <exception>
#include <stdexcept>
#include <csignal>
+#include <cfloat>
+#ifndef _MSC_VER
+#include <stdint.h>
+#endif // _MSC_VER
namespace doctest
{
@@ -216,6 +222,7 @@
bool success; // include successful assertions in output
bool case_sensitive; // if filtering should be case sensitive
bool exit; // if the program should be exited after the tests are ran/whatever
+ bool duration; // print the time duration of each test case
bool no_exitcode; // if the framework should return 0 as the exitcode
bool no_run; // to not run the tests at all (can be done with an "*" exclude)
bool no_version; // to not print the version of the framework
@@ -517,6 +524,10 @@
#endif
#include <io.h>
+#else // _WIN32
+
+#include <sys/time.h>
+
#endif // _WIN32
namespace doctest_detail_test_suite_ns
@@ -544,6 +555,7 @@
, m_may_fail(test_suite.m_may_fail)
, m_should_fail(test_suite.m_should_fail)
, m_expected_failures(test_suite.m_expected_failures)
+ , m_timeout(test_suite.m_timeout)
, m_file(file)
, m_line(line)
, m_template_id(template_id) {}
@@ -570,6 +582,7 @@
m_may_fail = other.m_may_fail;
m_should_fail = other.m_should_fail;
m_expected_failures = other.m_expected_failures;
+ m_timeout = other.m_timeout;
m_file = other.m_file;
m_line = other.m_line;
m_template_id = other.m_template_id;
@@ -754,6 +767,46 @@
return false;
}
+ typedef unsigned long long UInt64;
+
+#ifdef _WIN32
+
+ UInt64 getCurrentTicks() {
+ static UInt64 hz = 0, hzo = 0;
+ if(!hz) {
+ QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER*>(&hz));
+ QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&hzo));
+ }
+ UInt64 t;
+ QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&t));
+ return ((t - hzo) * 1000000) / hz;
+ }
+#else // _WIN32
+ UInt64 getCurrentTicks() {
+ timeval t;
+ gettimeofday(&t, 0);
+ return static_cast<UInt64>(t.tv_sec) * 1000000ull + static_cast<UInt64>(t.tv_usec);
+ }
+#endif // _WIN32
+
+ class Timer
+ {
+ public:
+ Timer()
+ : m_ticks(0) {}
+ void start() { m_ticks = getCurrentTicks(); }
+ unsigned int getElapsedMicroseconds() const {
+ return static_cast<unsigned int>(getCurrentTicks() - m_ticks);
+ }
+ unsigned int getElapsedMilliseconds() const {
+ return static_cast<unsigned int>(getElapsedMicroseconds() / 1000);
+ }
+ double getElapsedSeconds() const { return getElapsedMicroseconds() / 1000000.0; }
+
+ private:
+ UInt64 m_ticks;
+ };
+
// the current ContextState with which tests are being executed
ContextState*& getContextState() {
static ContextState* data = 0;
@@ -1841,7 +1894,7 @@
std::printf(" -c, --count prints the number of matching tests\n");
std::printf(" -ltc, --list-test-cases lists all matching tests by name\n");
std::printf(" -lts, --list-test-suites lists all matching test suites\n\n");
- // ==================================================================================== << 79
+ // ========================================================================================= << 79
DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
std::printf("The available <int>/<string> options/filters are:\n\n");
std::printf(" -tc, --test-case=<filters> filters tests by their name\n");
@@ -1866,6 +1919,7 @@
std::printf(" -s, --success=<bool> include successful assertions in output\n");
std::printf(" -cs, --case-sensitive=<bool> filters being treated as case sensitive\n");
std::printf(" -e, --exit=<bool> exits after the tests finish\n");
+ std::printf(" -d, --duration=<bool> prints the time duration of each test\n");
std::printf(" -nt, --no-throw=<bool> skips exceptions-related assert checks\n");
std::printf(" -ne, --no-exitcode=<bool> returns (or exits) always with success\n");
std::printf(" -nr, --no-run=<bool> skips all runtime doctest operations\n");
@@ -1876,7 +1930,7 @@
std::printf(" -ns, --no-skip=<bool> don't skip test cases marked as skip\n");
std::printf(" -npf, --no-path-filenames=<bool> only filenames and no paths in output\n");
std::printf(" -nln, --no-line-numbers=<bool> 0 instead of real line numbers in output\n");
- // ==================================================================================== << 79
+ // ========================================================================================= << 79
// clang-format on
DOCTEST_PRINTF_COLORED("\n[doctest] ", Color::Cyan);
@@ -1905,12 +1959,12 @@
DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "test cases: %4u",
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "test cases: %6u",
p->numTestsPassingFilters);
DOCTEST_PRINTF_COLORED(buff, Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d passed",
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d passed",
p->numTestsPassingFilters - p->numFailed);
DOCTEST_PRINTF_COLORED(buff,
(p->numTestsPassingFilters == 0 || anythingFailed) ?
@@ -1918,7 +1972,7 @@
Color::Green);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4u failed", p->numFailed);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6u failed", p->numFailed);
DOCTEST_PRINTF_COLORED(buff, p->numFailed > 0 ? Color::Red : Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
@@ -1926,24 +1980,24 @@
if(p->no_skipped_summary == false) {
int numSkipped = static_cast<unsigned>(getRegisteredTests().size()) -
p->numTestsPassingFilters;
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d skipped", numSkipped);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d skipped", numSkipped);
DOCTEST_PRINTF_COLORED(buff, numSkipped == 0 ? Color::None : Color::Yellow);
}
DOCTEST_PRINTF_COLORED("\n", Color::None);
DOCTEST_PRINTF_COLORED("[doctest] ", Color::Cyan);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "assertions: %4d", p->numAssertions);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "assertions: %6d", p->numAssertions);
DOCTEST_PRINTF_COLORED(buff, Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d passed",
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d passed",
p->numAssertions - p->numFailedAssertions);
DOCTEST_PRINTF_COLORED(
buff, (p->numAssertions == 0 || anythingFailed) ? Color::None : Color::Green);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " | ");
DOCTEST_PRINTF_COLORED(buff, Color::None);
- DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%4d failed", p->numFailedAssertions);
+ DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), "%6d failed", p->numFailedAssertions);
DOCTEST_PRINTF_COLORED(buff, p->numFailedAssertions > 0 ? Color::Red : Color::None);
DOCTEST_SNPRINTF(buff, DOCTEST_COUNTOF(buff), " |\n");
@@ -2032,6 +2086,7 @@
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-success, dt-s, success, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-case-sensitive, dt-cs, case_sensitive, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-exit, dt-e, exit, false);
+ DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-duration, dt-d, duration, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-throw, dt-nt, no_throw, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-exitcode, dt-ne, no_exitcode, false);
DOCTEST_PARSE_AS_BOOL_OR_FLAG(dt-no-run, dt-nr, no_run, false);
@@ -2228,6 +2283,9 @@
p->hasLoggedCurrentTestStart = false;
p->numFailedAssertionsForCurrentTestcase = 0;
p->subcasesPassed.clear();
+ double duration = 0;
+ Timer timer;
+ timer.start();
do {
// if the start has been logged from a previous iteration of this loop
if(p->hasLoggedCurrentTestStart)
@@ -2277,6 +2335,26 @@
} while(p->subcasesHasSkipped == true);
+ duration = timer.getElapsedSeconds();
+
+ if(Approx(p->currentTest->m_timeout).epsilon(DBL_EPSILON) != 0 &&
+ Approx(duration).epsilon(DBL_EPSILON) > p->currentTest->m_timeout) {
+ failed = true;
+ DOCTEST_LOG_START();
+ char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+ DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg),
+ "Test case exceeded time limit of %.6f!\n",
+ p->currentTest->m_timeout);
+ DOCTEST_PRINTF_COLORED(msg, Color::Red);
+ }
+
+ if(p->duration) {
+ char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
+ DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg), "%.6f s: %s\n", duration,
+ p->currentTest->m_name);
+ DOCTEST_PRINTF_COLORED(msg, Color::None);
+ }
+
if(data.m_should_fail) {
DOCTEST_LOG_START();
if(!failed) {
@@ -2298,9 +2376,10 @@
char msg[DOCTEST_SNPRINTF_BUFFER_LENGTH];
if(p->numFailedAssertionsForCurrentTestcase == data.m_expected_failures) {
failed = false;
- DOCTEST_SNPRINTF(msg, DOCTEST_COUNTOF(msg),
- "Failed exactly %d times as expected so marking it as not failed!\n",
- data.m_expected_failures);
+ DOCTEST_SNPRINTF(
+ msg, DOCTEST_COUNTOF(msg),
+ "Failed exactly %d times as expected so marking it as not failed!\n",
+ data.m_expected_failures);
DOCTEST_PRINTF_COLORED(msg, Color::Yellow);
} else {
failed = true;
diff --git a/examples/all_features/test_cases_and_suites.cpp b/examples/all_features/test_cases_and_suites.cpp
index 82f15df..5d5a30d 100644
--- a/examples/all_features/test_cases_and_suites.cpp
+++ b/examples/all_features/test_cases_and_suites.cpp
@@ -41,8 +41,9 @@
CHECK(data == 85);
}
-TEST_CASE("normal test in a test suite from a decorator" * doctest::test_suite("ts1")) {
- CHECK(true);
+TEST_CASE("normal test in a test suite from a decorator" * doctest::test_suite("ts1") *
+ doctest::timeout(0.000001)) {
+ MESSAGE("failing because of the timeout decorator!");
}
static bool shouldSkip() { return false; }
diff --git a/examples/all_features/test_output/abort_after.txt b/examples/all_features/test_output/abort_after.txt
index de53207..62ff2c4 100644
--- a/examples/all_features/test_output/abort_after.txt
+++ b/examples/all_features/test_output/abort_after.txt
@@ -19,7 +19,7 @@
Aborting - too many failed asserts!
===============================================================================
-[doctest] test cases: 1 | 0 passed | 1 failed |
-[doctest] assertions: 6 | 4 passed | 2 failed |
+[doctest] test cases: 1 | 0 passed | 1 failed |
+[doctest] assertions: 6 | 4 passed | 2 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/all_binary.txt b/examples/all_features/test_output/all_binary.txt
index 15c2012..01ff859 100644
--- a/examples/all_features/test_output/all_binary.txt
+++ b/examples/all_features/test_output/all_binary.txt
@@ -244,7 +244,7 @@
FAST_REQUIRE_UNARY_FALSE( 0 )
===============================================================================
-[doctest] test cases: 1 | 1 passed | 0 failed |
-[doctest] assertions: 32 | 32 passed | 0 failed |
+[doctest] test cases: 1 | 1 passed | 0 failed |
+[doctest] assertions: 32 | 32 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/alternative_macros.cpp.txt b/examples/all_features/test_output/alternative_macros.cpp.txt
index 56b5630..5eec05c 100644
--- a/examples/all_features/test_output/alternative_macros.cpp.txt
+++ b/examples/all_features/test_output/alternative_macros.cpp.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 1 | 1 passed | 0 failed |
-[doctest] assertions: 6 | 6 passed | 0 failed |
+[doctest] test cases: 1 | 1 passed | 0 failed |
+[doctest] assertions: 6 | 6 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/assertion_macros.cpp.txt b/examples/all_features/test_output/assertion_macros.cpp.txt
index 87ac5b5..8c2168e 100644
--- a/examples/all_features/test_output/assertion_macros.cpp.txt
+++ b/examples/all_features/test_output/assertion_macros.cpp.txt
@@ -291,7 +291,7 @@
FAST_REQUIRE_UNARY_FALSE( 1 )
===============================================================================
-[doctest] test cases: 20 | 4 passed | 16 failed |
-[doctest] assertions: 88 | 54 passed | 34 failed |
+[doctest] test cases: 20 | 4 passed | 16 failed |
+[doctest] assertions: 88 | 54 passed | 34 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/coverage_maxout.cpp.txt b/examples/all_features/test_output/coverage_maxout.cpp.txt
index 404dce7..3fcf020 100644
--- a/examples/all_features/test_output/coverage_maxout.cpp.txt
+++ b/examples/all_features/test_output/coverage_maxout.cpp.txt
@@ -52,7 +52,7 @@
unknown exception
===============================================================================
-[doctest] test cases: 4 | 0 passed | 4 failed |
-[doctest] assertions: 7 | 4 passed | 3 failed |
+[doctest] test cases: 4 | 0 passed | 4 failed |
+[doctest] assertions: 7 | 4 passed | 3 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/doctest_proxy.h.txt b/examples/all_features/test_output/doctest_proxy.h.txt
index ac2cbe4..4da210e 100644
--- a/examples/all_features/test_output/doctest_proxy.h.txt
+++ b/examples/all_features/test_output/doctest_proxy.h.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 0 | 0 passed | 0 failed |
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 0 | 0 passed | 0 failed |
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/filter_1.txt b/examples/all_features/test_output/filter_1.txt
index ac2cbe4..4da210e 100644
--- a/examples/all_features/test_output/filter_1.txt
+++ b/examples/all_features/test_output/filter_1.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 0 | 0 passed | 0 failed |
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 0 | 0 passed | 0 failed |
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/filter_2.txt b/examples/all_features/test_output/filter_2.txt
index 866201e..87e39cb 100644
--- a/examples/all_features/test_output/filter_2.txt
+++ b/examples/all_features/test_output/filter_2.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 0 | 0 passed | 0 failed | 71 skipped
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 0 | 0 passed | 0 failed | 71 skipped
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/filter_3.txt b/examples/all_features/test_output/filter_3.txt
index 9077a43..95f4251 100644
--- a/examples/all_features/test_output/filter_3.txt
+++ b/examples/all_features/test_output/filter_3.txt
@@ -26,7 +26,7 @@
lala
===============================================================================
-[doctest] test cases: 3 | 3 passed | 0 failed |
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 3 | 3 passed | 0 failed |
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/first_last.txt b/examples/all_features/test_output/first_last.txt
index a7027b6..72055b8 100644
--- a/examples/all_features/test_output/first_last.txt
+++ b/examples/all_features/test_output/first_last.txt
@@ -27,7 +27,7 @@
unknown exception
===============================================================================
-[doctest] test cases: 4 | 1 passed | 3 failed |
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 4 | 1 passed | 3 failed |
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/header.h.txt b/examples/all_features/test_output/header.h.txt
index 5a26a5b..8d9f3d6 100644
--- a/examples/all_features/test_output/header.h.txt
+++ b/examples/all_features/test_output/header.h.txt
@@ -19,7 +19,7 @@
header.h(0) FATAL ERROR!
===============================================================================
-[doctest] test cases: 4 | 1 passed | 3 failed |
-[doctest] assertions: 4 | 1 passed | 3 failed |
+[doctest] test cases: 4 | 1 passed | 3 failed |
+[doctest] assertions: 4 | 1 passed | 3 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/help.txt b/examples/all_features/test_output/help.txt
index c8ac6ca..aee1ca0 100644
--- a/examples/all_features/test_output/help.txt
+++ b/examples/all_features/test_output/help.txt
@@ -40,6 +40,7 @@
-s, --success=<bool> include successful assertions in output
-cs, --case-sensitive=<bool> filters being treated as case sensitive
-e, --exit=<bool> exits after the tests finish
+ -d, --duration=<bool> prints the time duration of each test
-nt, --no-throw=<bool> skips exceptions-related assert checks
-ne, --no-exitcode=<bool> returns (or exits) always with success
-nr, --no-run=<bool> skips all runtime doctest operations
diff --git a/examples/all_features/test_output/logging.cpp.txt b/examples/all_features/test_output/logging.cpp.txt
index 5cc1fc4..ac09c63 100644
--- a/examples/all_features/test_output/logging.cpp.txt
+++ b/examples/all_features/test_output/logging.cpp.txt
@@ -104,7 +104,7 @@
fail the test case and also end it
===============================================================================
-[doctest] test cases: 6 | 0 passed | 6 failed |
-[doctest] assertions: 11 | 0 passed | 11 failed |
+[doctest] test cases: 6 | 0 passed | 6 failed |
+[doctest] assertions: 11 | 0 passed | 11 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/main.cpp.txt b/examples/all_features/test_output/main.cpp.txt
index 302bada..4c473e7 100644
--- a/examples/all_features/test_output/main.cpp.txt
+++ b/examples/all_features/test_output/main.cpp.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 1 | 1 passed | 0 failed |
-[doctest] assertions: 1 | 1 passed | 0 failed |
+[doctest] test cases: 1 | 1 passed | 0 failed |
+[doctest] assertions: 1 | 1 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/order_1.txt b/examples/all_features/test_output/order_1.txt
index f6fb9bc..9f59587 100644
--- a/examples/all_features/test_output/order_1.txt
+++ b/examples/all_features/test_output/order_1.txt
@@ -98,7 +98,16 @@
Didn't fail exactly 1 times so marking it as failed!
===============================================================================
-[doctest] test cases: 15 | 6 passed | 9 failed |
-[doctest] assertions: 13 | 2 passed | 11 failed |
+test_cases_and_suites.cpp(0)
+TEST SUITE: ts1
+TEST CASE: normal test in a test suite from a decorator
+
+test_cases_and_suites.cpp(0) MESSAGE!
+ failing because of the timeout decorator!
+
+Test case exceeded time limit of 0.000001!
+===============================================================================
+[doctest] test cases: 15 | 5 passed | 10 failed |
+[doctest] assertions: 12 | 1 passed | 11 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/order_2.txt b/examples/all_features/test_output/order_2.txt
index 6c9e9f6..0f1dbb8 100644
--- a/examples/all_features/test_output/order_2.txt
+++ b/examples/all_features/test_output/order_2.txt
@@ -55,6 +55,15 @@
===============================================================================
test_cases_and_suites.cpp(0)
+TEST SUITE: ts1
+TEST CASE: normal test in a test suite from a decorator
+
+test_cases_and_suites.cpp(0) MESSAGE!
+ failing because of the timeout decorator!
+
+Test case exceeded time limit of 0.000001!
+===============================================================================
+test_cases_and_suites.cpp(0)
TEST SUITE: scoped test suite
TEST CASE: part of scoped
@@ -91,7 +100,7 @@
test_cases_and_suites.cpp(0) FATAL ERROR!
===============================================================================
-[doctest] test cases: 14 | 6 passed | 8 failed |
-[doctest] assertions: 12 | 2 passed | 10 failed |
+[doctest] test cases: 14 | 5 passed | 9 failed |
+[doctest] assertions: 11 | 1 passed | 10 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/order_3.txt b/examples/all_features/test_output/order_3.txt
index ac2cbe4..4da210e 100644
--- a/examples/all_features/test_output/order_3.txt
+++ b/examples/all_features/test_output/order_3.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 0 | 0 passed | 0 failed |
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 0 | 0 passed | 0 failed |
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/stringification.cpp.txt b/examples/all_features/test_output/stringification.cpp.txt
index 1305b3c..516cc9d 100644
--- a/examples/all_features/test_output/stringification.cpp.txt
+++ b/examples/all_features/test_output/stringification.cpp.txt
@@ -36,7 +36,7 @@
5
===============================================================================
-[doctest] test cases: 2 | 0 passed | 2 failed |
-[doctest] assertions: 4 | 0 passed | 4 failed |
+[doctest] test cases: 2 | 0 passed | 2 failed |
+[doctest] assertions: 4 | 0 passed | 4 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/subcases.cpp.txt b/examples/all_features/test_output/subcases.cpp.txt
index 32e07aa..7f35631 100644
--- a/examples/all_features/test_output/subcases.cpp.txt
+++ b/examples/all_features/test_output/subcases.cpp.txt
@@ -89,7 +89,7 @@
CHECK( 5 == 10 )
===============================================================================
-[doctest] test cases: 3 | 1 passed | 2 failed |
-[doctest] assertions: 17 | 14 passed | 3 failed |
+[doctest] test cases: 3 | 1 passed | 2 failed |
+[doctest] assertions: 17 | 14 passed | 3 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/templated_test_cases.cpp.txt b/examples/all_features/test_output/templated_test_cases.cpp.txt
index b3d3336..a7b161a 100644
--- a/examples/all_features/test_output/templated_test_cases.cpp.txt
+++ b/examples/all_features/test_output/templated_test_cases.cpp.txt
@@ -45,7 +45,7 @@
CHECK( 0 != 0 )
===============================================================================
-[doctest] test cases: 14 | 9 passed | 5 failed |
-[doctest] assertions: 18 | 13 passed | 5 failed |
+[doctest] test cases: 14 | 9 passed | 5 failed |
+[doctest] assertions: 18 | 13 passed | 5 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/test_cases_and_suites.cpp.txt b/examples/all_features/test_output/test_cases_and_suites.cpp.txt
index fa58cbf..c1087a8 100644
--- a/examples/all_features/test_output/test_cases_and_suites.cpp.txt
+++ b/examples/all_features/test_output/test_cases_and_suites.cpp.txt
@@ -39,6 +39,15 @@
===============================================================================
test_cases_and_suites.cpp(0)
+TEST SUITE: ts1
+TEST CASE: normal test in a test suite from a decorator
+
+test_cases_and_suites.cpp(0) MESSAGE!
+ failing because of the timeout decorator!
+
+Test case exceeded time limit of 0.000001!
+===============================================================================
+test_cases_and_suites.cpp(0)
DESCRIPTION: this test has overrided its skip decorator
TEST SUITE: skipped test cases
TEST CASE: unskipped
@@ -91,7 +100,7 @@
Didn't fail exactly 1 times so marking it as failed!
===============================================================================
-[doctest] test cases: 14 | 6 passed | 8 failed |
-[doctest] assertions: 12 | 2 passed | 10 failed |
+[doctest] test cases: 14 | 5 passed | 9 failed |
+[doctest] assertions: 11 | 1 passed | 10 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt b/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt
index ee8875b..05378ec 100644
--- a/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt
+++ b/examples/exe_with_static_libs/test_output/exe_with_static_libs.txt
@@ -4,6 +4,6 @@
hello from <lib_2_src.cpp>
hello from <main.cpp>
===============================================================================
-[doctest] test cases: 4 | 4 passed | 0 failed | 0 skipped
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 4 | 4 passed | 0 failed | 0 skipped
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
diff --git a/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt b/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt
index 642706b..5baaf68 100644
--- a/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt
+++ b/examples/executable_dll_and_plugin/test_output/executable_dll_and_plugin.txt
@@ -13,6 +13,6 @@
I am a test from the plugin!
===============================================================================
-[doctest] test cases: 5 | 4 passed | 1 failed | 0 skipped
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 5 | 4 passed | 1 failed | 0 skipped
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: FAILURE!
diff --git a/scripts/playground/test_output/playground.txt b/scripts/playground/test_output/playground.txt
index 8e3e669..cb40d7a 100644
--- a/scripts/playground/test_output/playground.txt
+++ b/scripts/playground/test_output/playground.txt
@@ -1,5 +1,5 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 0 | 0 passed | 0 failed | 0 skipped
-[doctest] assertions: 0 | 0 passed | 0 failed |
+[doctest] test cases: 0 | 0 passed | 0 failed | 0 skipped
+[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!