micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
|
Namespaces | |
namespace | detail |
Namespace with implementation details, not part of the public API. | |
namespace | literals |
User Defined Literals (UDL). Use them to suffix constants and obtain specific explicit types, like 1_i . | |
namespace | math |
Local mathematical functions. | |
namespace | operators |
Separate namespace with custom operators. | |
namespace | reflection |
namespace | type_traits |
Local type traits. Some may have standard equivalents, but better keep them locally. | |
namespace | utility |
Classes | |
struct | _t |
struct | colors |
Colours used to highlight pass vs. fail. More... | |
class | test_reporter |
Reporter to display the test results. For failed tests it prints the actual values of the operands, with their types. More... | |
class | test_runner |
The test runner. It maintains a list of test suites which automatically register themselves in their constructors. More... | |
class | test_suite |
Test suites are classes that represent a named group of test cases which self register to the runner. More... | |
class | test_suite_base |
Base class for all test suites. More... | |
struct | to_t |
Template for wrapping any other type. More... | |
Enumerations | |
enum class | verbosity { silent = 0 , quiet = 1 , normal = 2 , verbose = 3 } |
The verbosity levels. More... | |
Functions | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | _and (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic logical and. | |
template<class Expr_T > | |
constexpr auto | _not (const Expr_T &expr) |
Generic logical not. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | _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 | assume (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current()) |
Check a condition and, if false, abort. | |
test_reporter & | endl (test_reporter &stream) |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | 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 | eq (Lhs_T *lhs, Rhs_T *rhs) |
Pointer equality comparator. Matches pointers to any types. | |
int | 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 | 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 | ge (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic greater than or equal comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | ge (Lhs_T *lhs, Rhs_T *rhs) |
Pointer greater than or equal comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | gt (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic greater than comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | gt (Lhs_T *lhs, Rhs_T *rhs) |
Pointer greater than comparator. | |
void | initialize (int argc, char *argv[], const char *name="Main") |
Initialize the test framework. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | le (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic less than or equal comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | le (Lhs_T *lhs, Rhs_T *rhs) |
Generic less than or equal comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | lt (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic less than comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | lt (Lhs_T *lhs, Rhs_T *rhs) |
Generic less than comparator. | |
template<class T > | |
constexpr auto | mut (const T &t) noexcept -> T & |
Generic mutator, to remove const from any type. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | ne (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic non-equality comparator. | |
template<class Lhs_T , class Rhs_T > | |
constexpr auto | ne (Lhs_T *lhs, Rhs_T *rhs) |
Pointer non-equality comparator. | |
template<class Callable_T > | |
constexpr auto | nothrow (const Callable_T &func) |
Check if a callable doesn't throw an exception. | |
template<typename Callable_T , typename... Args_T> | |
void | 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 | throws (const Callable_T &func) |
Check if a callable throws a specific exception. | |
template<class Callable_T > | |
constexpr auto | throws (const Callable_T &func) |
Check if a callable throws an exception (any exception). | |
Variables | |
test_suite_base * | current_test_suite |
test_reporter | reporter |
test_runner | runner |
using micro_os_plus::micro_test_plus::_b = type_traits::value<bool> |
to_b
(since 3.2.0). Definition at line 358 of file literals.h.
using micro_os_plus::micro_test_plus::_c = type_traits::value<char> |
to_c
(since 3.2.0). Definition at line 360 of file literals.h.
using micro_os_plus::micro_test_plus::_d = type_traits::value<double> |
to_d
(since 3.2.0). Definition at line 400 of file literals.h.
using micro_os_plus::micro_test_plus::_f = type_traits::value<float> |
to_f
(since 3.2.0). Definition at line 398 of file literals.h.
using micro_os_plus::micro_test_plus::_i = type_traits::value<int> |
to_i
(since 3.2.0). Definition at line 366 of file literals.h.
using micro_os_plus::micro_test_plus::_i16 = type_traits::value<std::int16_t> |
to_i16
(since 3.2.0). Definition at line 384 of file literals.h.
using micro_os_plus::micro_test_plus::_i32 = type_traits::value<std::int32_t> |
to_i32
(since 3.2.0). Definition at line 386 of file literals.h.
using micro_os_plus::micro_test_plus::_i64 = type_traits::value<std::int64_t> |
to_i64
(since 3.2.0). Definition at line 388 of file literals.h.
using micro_os_plus::micro_test_plus::_i8 = type_traits::value<std::int8_t> |
to_i8
(since 3.2.0). Definition at line 382 of file literals.h.
using micro_os_plus::micro_test_plus::_l = type_traits::value<long> |
to_l
(since 3.2.0). Definition at line 368 of file literals.h.
using micro_os_plus::micro_test_plus::_ld = type_traits::value<long double> |
to_ld
(since 3.2.0). Definition at line 402 of file literals.h.
using micro_os_plus::micro_test_plus::_ll = type_traits::value<long long> |
to_ll
(since 3.2.0). Definition at line 370 of file literals.h.
using micro_os_plus::micro_test_plus::_s = type_traits::value<short> |
to_s
(since 3.2.0). Definition at line 364 of file literals.h.
using micro_os_plus::micro_test_plus::_sc = type_traits::value<signed char> |
to_sc
(since 3.2.0). Definition at line 362 of file literals.h.
using micro_os_plus::micro_test_plus::_u = type_traits::value<unsigned> |
to_u
(since 3.2.0). Definition at line 372 of file literals.h.
using micro_os_plus::micro_test_plus::_u16 = type_traits::value<std::uint16_t> |
to_u16
(since 3.2.0). Definition at line 392 of file literals.h.
using micro_os_plus::micro_test_plus::_u32 = type_traits::value<std::uint32_t> |
to_u32
(since 3.2.0). Definition at line 394 of file literals.h.
using micro_os_plus::micro_test_plus::_u64 = type_traits::value<std::uint64_t> |
to_u64
(since 3.2.0). Definition at line 396 of file literals.h.
using micro_os_plus::micro_test_plus::_u8 = type_traits::value<std::uint8_t> |
to_u8
(since 3.2.0). Definition at line 390 of file literals.h.
using micro_os_plus::micro_test_plus::_uc = type_traits::value<unsigned char> |
to_uc
(since 3.2.0). Definition at line 374 of file literals.h.
using micro_os_plus::micro_test_plus::_ul = type_traits::value<unsigned long> |
to_ul
(since 3.2.0). Definition at line 378 of file literals.h.
using micro_os_plus::micro_test_plus::_ull = type_traits::value<unsigned long long> |
to_ull
(since 3.2.0). Definition at line 380 of file literals.h.
using micro_os_plus::micro_test_plus::_us = type_traits::value<unsigned short> |
to_us
(since 3.2.0). Definition at line 376 of file literals.h.
Definition at line 73 of file test-reporter.h.
|
strong |
The verbosity levels.
Enumerator | |
---|---|
silent | |
quiet | |
normal | |
verbose |
Definition at line 65 of file test-reporter.h.
test_reporter & micro_os_plus::micro_test_plus::endl | ( | test_reporter & | stream | ) |
Definition at line 38 of file test-reporter.cpp.
|
constexprnoexcept |
Generic mutator, to remove const from any type.
Definition at line 482 of file micro-test-plus.h.
test_suite_base * micro_os_plus::micro_test_plus::current_test_suite |
Definition at line 205 of file micro-test-plus.cpp.
test_reporter micro_os_plus::micro_test_plus::reporter |
Definition at line 203 of file micro-test-plus.cpp.
test_runner micro_os_plus::micro_test_plus::runner |
Definition at line 202 of file micro-test-plus.cpp.