C++ source file with implementations for the µTest++ test suite methods. More...
Namespaces Index
Description
C++ source file with implementations for the µTest++ test suite methods.
This source file contains the core implementations for the test suite facilities of the µTest++ framework. It provides the logic for constructing, registering, and managing test suites and their associated test cases. The implementation covers initialisation and clean-up routines, execution of test suites and test cases, tracking of successful and failed checks, and integration with the test reporter for structured output.
The design ensures that test suites are non-copyable and non-movable, maintaining unique ownership and consistent state. Flexible support for callable objects enables a wide range of test suite definitions, facilitating expressive and maintainable test organisation across embedded and general C++ projects.
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:
46#if __has_include(<micro-os-plus/project-config.h>)
47#include <micro-os-plus/project-config.h>
48#elif __has_include(<micro-os-plus/config.h>)
50 "micro-os-plus/config.h is deprecated, rename to micro-os-plus/project-config.h and include it instead of micro-os-plus/config.h"
51#include <micro-os-plus/config.h>
54#if __has_include(<micro-os-plus/micro-test-plus-defines.h>)
55#include <micro-os-plus/micro-test-plus-defines.h>
58#if defined(MICRO_OS_PLUS_TRACE)
59#include <micro-os-plus/diag/trace.h>
69#pragma clang diagnostic ignored "-Wunknown-warning-option"
70#pragma clang diagnostic ignored "-Wc++98-compat"
71#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
73#pragma GCC diagnostic ignored "-Wredundant-tags"
74#pragma GCC diagnostic ignored "-Wsuggest-final-types"
75#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
95#if defined(MICRO_OS_PLUS_TRACE) \
96 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
98#pragma GCC diagnostic push
100#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
103 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name);
105#pragma GCC diagnostic pop
118#if defined(MICRO_OS_PLUS_TRACE) \
119 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
121#pragma GCC diagnostic push
122#if defined(__clang__)
123#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
126 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
128#pragma GCC diagnostic pop
149#if defined(MICRO_OS_PLUS_TRACE) \
150 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
152#pragma GCC diagnostic push
153#if defined(__clang__)
154#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
157 trace::printf ("%s '%s' %zu\n", __PRETTY_FUNCTION__, name, own_index_);
159#pragma GCC diagnostic pop
173#if defined(MICRO_OS_PLUS_TRACE) \
174 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
176#pragma GCC diagnostic push
177#if defined(__clang__)
178#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
181 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
183#pragma GCC diagnostic pop
225 std::unique_ptr<class subtest> child_test, suite& suite)
235#if defined(MICRO_OS_PLUS_TRACE) \
236 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
238#pragma GCC diagnostic push
239#if defined(__clang__)
240#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
243 trace::printf ("%s subtest '%s' executed one more subtest\n",
244 __PRETTY_FUNCTION__, name ());
246#pragma GCC diagnostic pop
253#if defined(MICRO_OS_PLUS_TRACE) \
254 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
256#pragma GCC diagnostic push
257#if defined(__clang__)
258#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
261 trace::printf ("%s suite '%s' totals\n", __PRETTY_FUNCTION__,
264#pragma GCC diagnostic pop
286#if defined(MICRO_OS_PLUS_TRACE) \
287 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
289#pragma GCC diagnostic push
290#if defined(__clang__)
291#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
294 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
296#pragma GCC diagnostic pop
309#if defined(MICRO_OS_PLUS_TRACE) \
310 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
312#pragma GCC diagnostic push
313#if defined(__clang__)
314#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
317 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
319#pragma GCC diagnostic pop
347#if defined(MICRO_OS_PLUS_TRACE) \
348 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
350#pragma GCC diagnostic push
351#if defined(__clang__)
352#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
355 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
357#pragma GCC diagnostic pop
370#if defined(MICRO_OS_PLUS_TRACE) \
371 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
373#pragma GCC diagnostic push
374#if defined(__clang__)
375#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
378 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
380#pragma GCC diagnostic pop
409#if defined(MICRO_OS_PLUS_TRACE) \
410 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
412#pragma GCC diagnostic push
413#if defined(__clang__)
414#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
417 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name);
419#pragma GCC diagnostic pop
434#if defined(MICRO_OS_PLUS_TRACE) \
435 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
437#pragma GCC diagnostic push
438#if defined(__clang__)
439#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
442 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
444#pragma GCC diagnostic pop
459#if defined(MICRO_OS_PLUS_TRACE) \
460 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
462#pragma GCC diagnostic push
463#if defined(__clang__)
464#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
467 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
469#pragma GCC diagnostic pop
484#if defined(MICRO_OS_PLUS_TRACE) \
485 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
487#pragma GCC diagnostic push
488#if defined(__clang__)
489#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
492 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
494#pragma GCC diagnostic pop
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.