micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::extension Namespace Reference

The templates and the concepts for extending the µTest++ testing framework. More...

Classes

struct  compare_op
 Relational comparator struct template. More...
struct  predicate_op
 Unary predicate struct template. More...

Concepts

concept  any_op
 Concept satisfied when at least one of two types is a framework expression type.
concept  approx_operand
 Concept satisfied when T is a valid operand of the approximate comparator.
concept  checkable
 Concept satisfied when a type can be used as a test expression in expect() or require().
concept  compare_tag
 Concept satisfied by a tag that defines a custom comparator.
concept  has_epsilon
 Deprecated concept satisfied when T is a framework floating-point wrapper with a tolerance.
concept  is_op
 Concept satisfied when a type is a framework expression type.
concept  predicate_tag
 Concept satisfied by a tag that defines a custom predicate.
concept  printable
 Concept satisfied when a type can be appended to the message of a check result via operator<<.

Detailed Description

The extension namespace holds what the applications use to write their own comparators, predicates, operators, and helpers, reported as the built-in ones are:

  • compare_op and predicate_op (defined in detail.h), the expressions of the binary comparisons and of the unary predicates, parametrised by a tag that defines the operation and its symbol in the failure reports; they are built from the operands and a tag object, for example compare_op{ lhs, rhs, my_tag{} }, with the template arguments deduced, and the tag satisfies compare_tag (predicate_tag for the predicates);
  • the C++20 concepts with the same constraints as the framework itself: whether a type is a framework expression type (is_op, any_op), and whether it is accepted by expect() and require() (checkable) or by the message operator (printable), and the constraints of the tags (compare_tag, predicate_tag) and of the operands of the approximate comparator (approx_operand); with the deprecated functionality enabled, they also tell whether a deprecated value wrapper carries a floating-point tolerance (has_epsilon).

The namespace is separate from the top namespace, so that using namespace micro_os_plus::micro_test_plus does not bring these generic names into the application code; refer to them qualified, as mt::extension::is_op<T>.