18#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
19#include <micro-os-plus/config.h>
30#pragma GCC diagnostic ignored "-Waggregate-return"
32#pragma clang diagnostic ignored "-Wc++98-compat"
33#pragma clang diagnostic ignored "-Wexit-time-destructors"
34#pragma clang diagnostic ignored "-Wglobal-constructors"
35#pragma clang diagnostic ignored "-Wunknown-warning-option"
58#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
59 printf (
"%s\n", __PRETTY_FUNCTION__);
61 runner.initialize (argc, argv, name);
79 return runner.exit_code ();
90#pragma GCC diagnostic push
92#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
94 const char* p = strrchr (name,
'/');
99#pragma GCC diagnostic pop
106#if defined(__clang__)
107#pragma clang diagnostic push
108#pragma clang diagnostic ignored "-Wdocumentation"
124#if defined(__clang__)
125#pragma clang diagnostic pop
128 is_match (std::string_view input, std::string_view pattern)
130 if (std::empty (pattern))
132 return std::empty (input);
135 if (std::empty (input))
137 return pattern[0] ==
'*' ?
is_match (input, pattern.substr (1))
141 if (pattern[0] !=
'?' and pattern[0] !=
'*' and pattern[0] != input[0])
146 if (pattern[0] ==
'*')
148 for (
decltype (std::size (input)) i = 0u; i <= std::size (input);
151 if (
is_match (input.substr (i), pattern.substr (1)))
159 return is_match (input.substr (1), pattern.substr (1));
183 printf (
"%s\n", __PRETTY_FUNCTION__);
199#pragma GCC diagnostic push
200#if defined(__clang__)
201#pragma clang diagnostic ignored "-Wexit-time-destructors"
202#pragma clang diagnostic ignored "-Wglobal-constructors"
213#pragma GCC diagnostic pop
const reflection::source_location location_
constexpr bool value() const
~deferred_reporter_base()
deferred_reporter_base(bool value, const reflection::source_location location)
Local implementation of the std::source_location.
Reporter to display the test results. For failed tests it prints the actual values of the operands,...
The test runner. It maintains a list of test suites which automatically register themselves in their ...
Base class for all test suites.
int exit_code(void)
Complete the test and return the exit code.
void initialize(int argc, char *argv[], const char *name="Main")
Initialize the test framework.
bool is_match(std::string_view input, std::string_view pattern)
Check if a string matches a pattern.
const char * short_name(const char *name)
test_suite_base * current_test_suite