micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
Loading...
Searching...
No Matches
micro-test-plus.h File Reference
#include "reflection.h"
#include "math.h"
#include "type-traits.h"
#include "literals.h"
#include "test-suite.h"
#include "test-runner.h"
#include "test-reporter.h"
#include "detail.h"
#include "test-reporter-inlines.h"
#include "inlines.h"

Go to the source code of this file.

Namespaces

namespace  micro_os_plus
 
namespace  micro_os_plus::micro_test_plus
 
namespace  micro_os_plus::micro_test_plus::operators
 Separate namespace with custom operators.
 
namespace  micro_os_plus::micro_test_plus::utility
 

Functions

template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::_and (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic logical and.
 
template<class Expr_T >
constexpr auto micro_os_plus::micro_test_plus::_not (const Expr_T &expr)
 Generic logical not.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::_or (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic logical or.
 
template<class Expr_T , type_traits::requires_t< type_traits::is_op_v< Expr_T > or type_traits::is_convertible_v< Expr_T, bool > > = 0>
constexpr auto micro_os_plus::micro_test_plus::assume (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
 Check a condition and, if false, abort.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::eq (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic equality comparator. Matches any non-pointer type.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::eq (Lhs_T *lhs, Rhs_T *rhs)
 Pointer equality comparator. Matches pointers to any types.
 
int micro_os_plus::micro_test_plus::exit_code (void)
 Complete the test and return the exit code.
 
template<class Expr_T , type_traits::requires_t< type_traits::is_op_v< Expr_T > or type_traits::is_convertible_v< Expr_T, bool > > = 0>
constexpr auto micro_os_plus::micro_test_plus::expect (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
 Evaluate a generic condition and report the results.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::ge (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic greater than or equal comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::ge (Lhs_T *lhs, Rhs_T *rhs)
 Pointer greater than or equal comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::gt (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic greater than comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::gt (Lhs_T *lhs, Rhs_T *rhs)
 Pointer greater than comparator.
 
void micro_os_plus::micro_test_plus::initialize (int argc, char *argv[], const char *name="Main")
 Initialize the test framework.
 
bool micro_os_plus::micro_test_plus::utility::is_match (std::string_view input, std::string_view pattern)
 Check if a string matches a pattern.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::le (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic less than or equal comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::le (Lhs_T *lhs, Rhs_T *rhs)
 Generic less than or equal comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::lt (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic less than comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::lt (Lhs_T *lhs, Rhs_T *rhs)
 Generic less than comparator.
 
template<class T >
constexpr auto micro_os_plus::micro_test_plus::mut (const T &t) noexcept -> T &
 Generic mutator, to remove const from any type.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::ne (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic non-equality comparator.
 
template<class Lhs_T , class Rhs_T >
constexpr auto micro_os_plus::micro_test_plus::ne (Lhs_T *lhs, Rhs_T *rhs)
 Pointer non-equality comparator.
 
template<class Callable_T >
constexpr auto micro_os_plus::micro_test_plus::nothrow (const Callable_T &func)
 Check if a callable doesn't throw an exception.
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator and (const Lhs_T &lhs, const Rhs_T &rhs)
 Logical && (and) operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class T , type_traits::requires_t< type_traits::is_op_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator not (const T &t)
 Logical ! (not) operator. It matches only if the operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator or (const Lhs_T &lhs, const Rhs_T &rhs)
 Logical || (or) operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator!= (const Lhs_T &lhs, const Rhs_T &rhs)
 Non-equality operator. It matches only if at least one operand is of local type (derived from local op).
 
constexpr auto micro_os_plus::micro_test_plus::operators::operator!= (std::string_view lhs, std::string_view rhs)
 Non-equality operator for string_view objects.
 
template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator!= (T &&lhs, T &&rhs)
 Non-equality operator for containers.
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator< (const Lhs_T &lhs, const Rhs_T &rhs)
 Less than operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator<= (const Lhs_T &lhs, const Rhs_T &rhs)
 Less than or equal operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator== (const Lhs_T &lhs, const Rhs_T &rhs)
 Equality operator. It matches only if at least one operand is of local type (derived from local op).
 
constexpr auto micro_os_plus::micro_test_plus::operators::operator== (std::string_view lhs, std::string_view rhs)
 Equality operator for string_view objects.
 
template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator== (T &&lhs, T &&rhs)
 Equality operator for containers.
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator> (const Lhs_T &lhs, const Rhs_T &rhs)
 Greater than operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator>= (const Lhs_T &lhs, const Rhs_T &rhs)
 Greater than or equal operator. It matches only if at least one operand is of local type (derived from local op).
 
template<class T = std::string_view, class Delim_T >
auto micro_os_plus::micro_test_plus::utility::split (T input, Delim_T delim) -> std::vector< T >
 Split a string into a vector of sub-strings.
 
template<typename Callable_T , typename... Args_T>
void micro_os_plus::micro_test_plus::test_case (const char *name, Callable_T &&callable, Args_T &&... arguments)
 Define and execute a test case.
 
template<class Exception_T , class Callable_T >
constexpr auto micro_os_plus::micro_test_plus::throws (const Callable_T &func)
 Check if a callable throws a specific exception.
 
template<class Callable_T >
constexpr auto micro_os_plus::micro_test_plus::throws (const Callable_T &func)
 Check if a callable throws an exception (any exception).
 

Variables

test_suite_basemicro_os_plus::micro_test_plus::current_test_suite
 
test_reporter micro_os_plus::micro_test_plus::reporter
 
test_runner micro_os_plus::micro_test_plus::runner