19#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
20#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 "-Wc++98-c++11-c++14-compat"
34#pragma clang diagnostic ignored "-Wunknown-warning-option"
43#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
44 printf (
"%s\n", __PRETTY_FUNCTION__);
48#pragma GCC diagnostic push
50#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
55#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
56 printf (
"%s\n", __PRETTY_FUNCTION__);
64#if !(defined(MICRO_OS_PLUS_INCLUDE_STARTUP) && defined(MICRO_OS_PLUS_TRACE))
65#if defined(MICRO_OS_PLUS_DEBUG)
67 for (
int i = 0; i < argc; ++i)
73 printf (
"'%s'", argv[i]);
80 for (
int i = 0; i < argc; ++i)
82 if (strcmp (argv[i],
"--verbose") == 0)
86 else if (strcmp (argv[i],
"--quiet") == 0)
90 else if (strcmp (argv[i],
"--silent") == 0)
101#if !(defined(MICRO_OS_PLUS_INCLUDE_STARTUP) && defined(MICRO_OS_PLUS_TRACE))
104#if defined(__clang__)
105 printf (
"Built with clang " __VERSION__);
106#elif defined(__GNUC__)
107 printf (
"Built with GCC " __VERSION__);
108#elif defined(_MSC_VER)
110 printf (
"Built with MSVC %d", _MSC_VER);
112 printf (
"Built with an unknown compiler");
114#if !(defined(__APPLE__) || defined(__linux__) || defined(__unix__) \
117#if defined(__ARM_PCS_VFP) || defined(__ARM_FP)
118 printf (
", with FP");
123#if defined(__EXCEPTIONS)
124 printf (
", with exceptions");
126 printf (
", no exceptions");
128#if defined(MICRO_OS_PLUS_DEBUG)
129 printf (
", with MICRO_OS_PLUS_DEBUG");
144#pragma GCC diagnostic pop
149 bool was_successful =
true;
165 suite->end_test_suite ();
167 was_successful &= suite->was_successful ();
174 return was_successful ? 0 : 1;
181 printf (
"%s\n", __PRETTY_FUNCTION__);
186 suites_ =
new std::vector<test_suite_base*> ();
std::vector< test_suite_base * > * suites_
Pointer to array of registered test suites. Statically initialised to zero as BSS,...
constexpr const char * name(void)
test_suite_base * default_test_suite_
Pointer to the default test suite which groups the main tests.
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.
void register_test_suite(test_suite_base *suite)
Called by test suite constructors to register them to the runner.
const char * default_suite_name_
Base class for all test suites.
constexpr bool unused(void)
If all counter are null, it is unused.
void end_test_suite(void)
Mark the end of the test suite.
void begin_test_suite(void)
Begin the execution of the test suite.
constexpr bool was_successful(void)
Get the test suite result.
test_suite_base * current_test_suite
verbosity
The verbosity levels.