47#ifndef MICRO_TEST_PLUS_INLINES_H_
48#define MICRO_TEST_PLUS_INLINES_H_
57#pragma GCC diagnostic push
58#pragma GCC diagnostic ignored "-Waggregate-return"
59#pragma GCC diagnostic ignored "-Wpadded"
61#pragma clang diagnostic ignored "-Wc++98-compat"
62#pragma clang diagnostic ignored "-Wc++98-c++11-c++14-c++17-compat-pedantic"
71#pragma clang diagnostic push
72#pragma clang diagnostic ignored "-Wdocumentation"
109#if defined(__clang__)
110#pragma clang diagnostic pop
112 template <
typename Callable_T,
typename... Args_T>
114 test_case (
const char* name, Callable_T&& callable, Args_T&&... arguments)
117 printf (
"%s\n", __PRETTY_FUNCTION__);
121 std::invoke (std::forward<Callable_T> (callable),
122 std::forward<Args_T> (arguments)...);
193#if defined(__cpp_exceptions)
205 template <
class Exception_T,
class Callable_T>
206 [[nodiscard]]
constexpr auto
207 throws (
const Callable_T& func)
222 template <
class Callable_T>
223 [[nodiscard]]
constexpr auto
224 throws (
const Callable_T& func)
240 template <
class Callable_T>
241 [[nodiscard]]
constexpr auto
273 template <
class T = std::
string_view,
class Delim_T>
275 split (T input, Delim_T delim) -> std::vector<T>
277 std::vector<T> output{};
279 while (first < std::size (input))
281 const auto second = input.find_first_of (delim, first);
284 output.emplace_back (input.substr (first, second - first));
286 if (second == T::npos)
302#pragma GCC diagnostic pop
Deferred reporter class template for a specific expression.
Local implementation of source location information for diagnostics.
constexpr auto assume(const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
Check a condition and, if false, abort test execution.
constexpr auto nothrow(const Callable_T &func)
Check if a callable does not throw an exception.
constexpr auto expect(const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
Evaluate a generic condition and report the results.
void test_case(const char *name, Callable_T &&callable, Args_T &&... arguments)
Define and execute a test case.
auto split(T input, Delim_T delim) -> std::vector< T >
Split a string into a vector of sub-strings.
typename requires_< Cond >::type requires_t
Alias template for extracting the type member from requires_.
constexpr auto is_convertible_v
Variable template to determine if one type is convertible to another.
constexpr auto is_op_v
Variable template to determine if a type derives from op.
Primary namespace for the µTest++ testing framework.
test_suite_base * current_test_suite
Global pointer references the currently active test suite.
Operator struct template to check if an expression does not throw any exception.
Operator struct template to check if an expression throws a specific exception.