C++ source file with implementations for the µTest++ test runner methods. More...
Namespaces Index
Description
C++ source file with implementations for the µTest++ test runner methods.
This source file contains the core implementations for the test runner facilities of the µTest++ framework. It provides the logic for initialising the test environment, registering and managing test suites, handling command-line arguments, orchestrating test execution, and determining the overall test result. The implementation supports automated discovery and execution of test suites, flexible verbosity control, and robust mechanisms for aborting test execution in critical scenarios.
All definitions reside within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.
This file must be included when building the µTest++ library.
File Listing
The file content with the documentation metadata removed is:
41#if defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
42#include <micro-os-plus/config.h>
53#pragma GCC diagnostic ignored "-Waggregate-return"
55#pragma clang diagnostic ignored "-Wc++98-compat"
56#pragma clang diagnostic ignored "-Wc++98-c++11-c++14-compat"
57#pragma clang diagnostic ignored "-Wunknown-warning-option"
75#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
76 printf ("%s\n", __PRETTY_FUNCTION__);
80#pragma GCC diagnostic push
82#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
99#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
100 printf ("%s\n", __PRETTY_FUNCTION__);
103#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
105 timespec_get (&begin_time, TIME_UTC);
107 clock_gettime (CLOCK_MONOTONIC, &begin_time);
116#if !(defined(MICRO_OS_PLUS_INCLUDE_STARTUP) && defined(MICRO_OS_PLUS_TRACE))
117#if defined(MICRO_OS_PLUS_DEBUG)
119 for (int i = 0; i < argc; ++i)
125 printf ("'%s'", argv[i]);
132 const char* reporter_name = "tap";
133 for (int i = 0; i < argc; ++i)
135 if (strcmp (argv[i], "--verbose") == 0)
139 else if (strcmp (argv[i], "--quiet") == 0)
143 else if (strcmp (argv[i], "--silent") == 0)
147 else if (strncmp (argv[i], "--reporter=", 11) == 0)
149 reporter_name = argv[i] + 11;
154 if (strcmp (reporter_name, "basic") == 0)
158 else if (strcmp (reporter_name, "tap") == 0)
164 fprintf (stderr, "error: unknown reporter '%s'\n", reporter_name);
171#if !(defined(MICRO_OS_PLUS_INCLUDE_STARTUP) && defined(MICRO_OS_PLUS_TRACE))
174#if defined(__clang__)
175 printf ("Built with clang " __VERSION__);
176#elif defined(__GNUC__)
177 printf ("Built with GCC " __VERSION__);
178#elif defined(_MSC_VER)
180 printf ("Built with MSVC %d", _MSC_VER);
182 printf ("Built with an unknown compiler");
184#if !(defined(__APPLE__) || defined(__linux__) || defined(__unix__) \
187#if defined(__ARM_PCS_VFP) || defined(__ARM_FP)
188 printf (", with FP");
193#if defined(__EXCEPTIONS)
194 printf (", with exceptions");
196 printf (", no exceptions");
198#if defined(MICRO_OS_PLUS_DEBUG)
199 printf (", with MICRO_OS_PLUS_DEBUG");
215#pragma GCC diagnostic pop
220 bool was_successful = true;
254#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
256 timespec_get (&end_time, TIME_UTC);
258 clock_gettime (CLOCK_MONOTONIC, &end_time);
264 return was_successful ? 0 : 1;
282 printf ("%s\n", __PRETTY_FUNCTION__);
287 test_suites = new std::vector<test_suite_base*> ();
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.14.0.