In complex projects, the definitions in the micro_test_plus
namespace might interfere with application definitions.
- Note
- To avoid names clashes, it is recommended to use the comparator functions with explicit namespaces, possibly aliased to shorter names.
However, for those who prefer brevity, it is also possible to declare the namespace micro_os_plus::micro_test_plus
at scope level, and use all the definitions directly.
- Example
{
expect (
eq (compute_answer (), 42)) <<
"answer is 42";
});
}
constexpr auto expect(const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
Evaluate a generic condition and report the results.
constexpr auto eq(const Lhs_T &lhs, const Rhs_T &rhs)
Generic equality comparator. Matches any non-pointer type.
void test_case(const char *name, Callable_T &&callable, Args_T &&... arguments)
Define and execute a test case.