Commit 3ce41950 authored by Dominik Charousset's avatar Dominik Charousset

Abort unit tests after 10s

parent 111e7c12
......@@ -130,11 +130,16 @@ inline void caf_check_value(V1 v1, V2 v2, const char* fname, size_t line,
#define CAF_VERBOSE_EVAL(LineOfCode) \
CAF_PRINT(#LineOfCode << " = " << (LineOfCode));
#define CAF_TEST(testname) \
auto caf_test_scope_guard = ::caf::detail::make_scope_guard([] { \
std::cout << caf_error_count() << " error(s) detected" << std::endl; \
}); \
set_default_test_settings(); \
#define CAF_TEST(testname) \
::std::thread{[] { \
::std::this_thread::sleep_for(std::chrono::seconds(10)); \
::std::cerr << "WATCHDOG: unit test did finish within 10s, abort\n"; \
::abort(); \
}}.detach(); \
auto caf_test_scope_guard = ::caf::detail::make_scope_guard([] { \
std::cout << caf_error_count() << " error(s) detected" << std::endl; \
}); \
set_default_test_settings(); \
CAF_LOGF_INFO("run unit test " << #testname)
#define CAF_TEST_RESULT() ((caf_error_count() == 0) ? 0 : -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment