19#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
20#include <micro-os-plus/config.h>
31#pragma GCC diagnostic ignored "-Waggregate-return"
33#pragma clang diagnostic ignored "-Wc++98-compat"
34#pragma clang diagnostic ignored "-Wexit-time-destructors"
35#pragma clang diagnostic ignored "-Wglobal-constructors"
36#pragma clang diagnostic ignored "-Wunknown-warning-option"
59#if defined(MICRO_TEST_PLUS_TRACE)
60 printf (
"%s\n", __PRETTY_FUNCTION__);
91#pragma GCC diagnostic push
93#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
95 const char* p = strrchr (name,
'/');
100#pragma GCC diagnostic pop
123 is_match (std::string_view input, std::string_view pattern)
125 if (std::empty (pattern))
127 return std::empty (input);
130 if (std::empty (input))
132 return pattern[0] ==
'*' ?
is_match (input, pattern.substr (1))
136 if (pattern[0] !=
'?' and pattern[0] !=
'*' and pattern[0] != input[0])
141 if (pattern[0] ==
'*')
143 for (
decltype (std::size (input)) i = 0u; i <= std::size (input);
146 if (
is_match (input.substr (i), pattern.substr (1)))
154 return is_match (input.substr (1), pattern.substr (1));
163 : value_{ value }, location_{ location }
178 printf (
"%s\n", __PRETTY_FUNCTION__);
194#pragma GCC diagnostic push
195#if defined(__clang__)
196#pragma clang diagnostic ignored "-Wexit-time-destructors"
197#pragma clang diagnostic ignored "-Wglobal-constructors"
208#pragma GCC diagnostic pop
~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 ...
int exit_code(void)
Return 0 if the all tests were successful, 1 otherwise.
void initialize(int argc, char *argv[], const char *name)
Pass the main arguments explicitly, if the default constructor was used.
Base class for all test suites.
void increment_failed(void)
Count one more failed test conditions.
void increment_successful(void)
Count one more passed test conditions.
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