|
micro-test-plus 3.2.1
The µTest++ Testing Framework
|
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 357 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 359 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 399 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 397 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 365 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 383 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 385 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 387 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 381 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 367 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 401 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 369 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 363 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 361 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 371 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 391 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 393 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 395 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 389 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 373 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 377 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 379 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 375 of file literals.h.
Definition at line 72 of file test-reporter.h.
|
strong |
The verbosity levels.
| Enumerator | |
|---|---|
| silent | |
| quiet | |
| normal | |
| verbose | |
Definition at line 64 of file test-reporter.h.
| test_reporter & micro_os_plus::micro_test_plus::endl | ( | test_reporter & | stream | ) |
Definition at line 37 of file test-reporter.cpp.
|
nodiscardconstexprnoexcept |
Generic mutator, to remove const from any type.
Definition at line 481 of file micro-test-plus.h.
| test_suite_base * micro_os_plus::micro_test_plus::current_test_suite |
Definition at line 210 of file micro-test-plus.cpp.
| test_reporter micro_os_plus::micro_test_plus::reporter |
Definition at line 208 of file micro-test-plus.cpp.
| test_runner micro_os_plus::micro_test_plus::runner |
Definition at line 207 of file micro-test-plus.cpp.