Commit 390195a4 authored by Dominik Charousset's avatar Dominik Charousset

Add macros for implementing custom checks

(cherry picked from commit 7ea7cb48)
parent d6b47327
......@@ -523,6 +523,28 @@ using caf_test_case_auto_fixture = caf::test::dummy_fixture;
::caf::test::engine::last_check_line(__LINE__); \
} while (false)
#define CAF_CHECK_PASSED(msg) \
do { \
auto out = ::caf::test::logger::instance().massive(); \
out << term::green << "** " << term::blue << __FILE__ << term::yellow \
<< ":" << term::blue << __LINE__ \
<< ::caf::test::detail::fill(__LINE__) << term::reset << msg << '\n'; \
::caf::test::engine::current_test()->pass(); \
::caf::test::engine::last_check_file(__FILE__); \
::caf::test::engine::last_check_line(__LINE__); \
} while (false)
#define CAF_CHECK_FAILED(msg) \
do { \
auto out = ::caf::test::logger::instance().massive(); \
out << term::red << "!! " << term::blue << __FILE__ << term::yellow << ":" \
<< term::blue << __LINE__ << ::caf::test::detail::fill(__LINE__) \
<< term::reset << msg << '\n'; \
::caf::test::engine::current_test()->fail(false); \
::caf::test::engine::last_check_file(__FILE__); \
::caf::test::engine::last_check_line(__LINE__); \
} while (false)
#define CAF_CHECK(...) \
do { \
static_cast<void>(::caf::test::detail::check( \
......
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