41#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
42#include <micro-os-plus/config.h>
52#pragma GCC diagnostic ignored "-Waggregate-return"
54#pragma clang diagnostic ignored "-Wc++98-compat"
55#pragma clang diagnostic ignored "-Wc++98-c++11-c++14-compat"
56#pragma clang diagnostic ignored "-Wunknown-warning-option"
74#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
75 printf (
"%s\n", __PRETTY_FUNCTION__);
79#pragma GCC diagnostic push
81#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
98#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
99 printf (
"%s\n", __PRETTY_FUNCTION__);
107#if !(defined(MICRO_OS_PLUS_INCLUDE_STARTUP) && defined(MICRO_OS_PLUS_TRACE))
108#if defined(MICRO_OS_PLUS_DEBUG)
110 for (
int i = 0; i < argc; ++i)
116 printf (
"'%s'", argv[i]);
123 for (
int i = 0; i < argc; ++i)
125 if (strcmp (argv[i],
"--verbose") == 0)
129 else if (strcmp (argv[i],
"--quiet") == 0)
133 else if (strcmp (argv[i],
"--silent") == 0)
144#if !(defined(MICRO_OS_PLUS_INCLUDE_STARTUP) && defined(MICRO_OS_PLUS_TRACE))
147#if defined(__clang__)
148 printf (
"Built with clang " __VERSION__);
149#elif defined(__GNUC__)
150 printf (
"Built with GCC " __VERSION__);
151#elif defined(_MSC_VER)
153 printf (
"Built with MSVC %d", _MSC_VER);
155 printf (
"Built with an unknown compiler");
157#if !(defined(__APPLE__) || defined(__linux__) || defined(__unix__) \
160#if defined(__ARM_PCS_VFP) || defined(__ARM_FP)
161 printf (
", with FP");
166#if defined(__EXCEPTIONS)
167 printf (
", with exceptions");
169 printf (
", no exceptions");
171#if defined(MICRO_OS_PLUS_DEBUG)
172 printf (
", with MICRO_OS_PLUS_DEBUG");
187#pragma GCC diagnostic pop
192 bool was_successful =
true;
206 suite->begin_test_suite ();
208 suite->end_test_suite ();
210 was_successful &= suite->was_successful ();
217 return was_successful ? 0 : 1;
235 printf (
"%s\n", __PRETTY_FUNCTION__);
240 suites_ =
new std::vector<test_suite_base*> ();
char ** argv_
Stores the argument vector passed to the test runner.
void abort(void)
Aborts test execution immediately.
std::vector< test_suite_base * > * suites_
Pointer to the array of registered test suites.
test_runner()
Default constructor for the test_runner class.
constexpr const char * name(void)
Retrieves the name of the default test suite.
int argc_
Stores the argument count passed to the test runner.
test_suite_base * default_test_suite_
Pointer to the default test suite which groups the main tests.
int exit_code(void)
Returns 0 if all tests were successful, 1 otherwise.
void initialize(int argc, char *argv[], const char *name)
Initialises the test runner with command-line arguments and an optional suite name.
void register_test_suite(test_suite_base *suite)
Registers a test suite with the runner.
const char * default_suite_name_
The name of the default test suite.
Base class for all test suites.
Main C++ header with the declarations for the µTest++ Testing Framework.
Primary namespace for the µTest++ testing framework.
verbosity verbosity_t
Type alias for the verbosity enumeration used in test reporting.
test_suite_base * current_test_suite
Global pointer references the currently active test suite.
verbosity
The verbosity levels for test reporting.
test_reporter reporter
Global instance of test_reporter.