C++ header file with inline implementations for the µTest++ test suite. More...
Namespaces Index
Description
C++ header file with inline implementations for the µTest++ test suite.
This header provides the inline implementations for the test suite facilities used within the µTest++ framework. It defines the logic for constructing and registering test suites, including the binding of callable objects and their arguments for flexible test suite definitions.
The implementation ensures that each test suite is automatically registered with the global test runner upon construction, enabling automated discovery and execution of test suites. The use of std::bind allows for versatile test suite initialisation with arbitrary callable types and arguments.
All definitions reside within the micro_os_plus::micro_test_plus namespace, maintaining a clear separation from user code and minimising the risk of naming conflicts.
The header files are organised within the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.
This file is intended solely for internal use within the framework and should not be included directly by user code.
File Listing
The file content with the documentation metadata removed is:
46#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_TEST_INLINES_H_
47#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_TEST_INLINES_H_
51#if defined(__cplusplus)
58#if __has_include("micro-os-plus/diag/trace.h")
59#include "micro-os-plus/diag/trace.h"
68#pragma GCC diagnostic push
70#pragma GCC diagnostic ignored "-Waggregate-return"
72#pragma clang diagnostic ignored "-Wunknown-warning-option"
73#pragma clang diagnostic ignored "-Wc++98-compat"
74#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
75#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
77#pragma GCC diagnostic ignored "-Wredundant-tags"
192 template <typename Self_T>
193 template <typename Callable_T, typename... Args_T>
196 Args_T&&... arguments)
204 if constexpr (sizeof...(arguments) == 0)
206 callable_ = std::forward<Callable_T> (callable);
210 callable_ = std::bind (std::forward<Callable_T> (callable),
211 std::placeholders::_1,
212 std::forward<Args_T> (arguments)...);
215#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
216 trace::printf ("%s '%s' %zu\n", __PRETTY_FUNCTION__, name, own_index_);
226 template <typename Self_T>
229#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
230 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name_);
244 template <typename Callable_T, typename... Args_T>
248 Args_T&&... arguments)
250 std::forward<Callable_T> (callable),
251 std::forward<Args_T> (arguments)... },
252 parent_suite_{ parent_suite }, nesting_depth_{ nesting_depth }
254#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
255 trace::printf ("%s '%s' %zu %zu\n", __PRETTY_FUNCTION__, name, own_index_,
266 template <typename Callable_T, typename... Args_T>
269 Args_T&&... arguments)
271#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
272 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name);
276 auto child_subtest = std::make_unique<subtest> (
278 std::forward<Callable_T> (callable),
279 std::forward<Args_T> (arguments)...);
290 template <class Expr_T>
305 template <class Expr_T>
333 template <typename Callable_T, typename... Args_T>
335 Args_T&&... arguments)
337 std::forward<Args_T> (arguments)... }
339#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
340 trace::printf ("%s '%s' %zu\n", __PRETTY_FUNCTION__, name, own_index_);
345#pragma GCC diagnostic push
347#if defined(__clang__)
348#pragma clang diagnostic ignored "-Wdocumentation"
388 template <typename Callable_T, typename... Args_T>
392#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
393 trace::printf ("%s '%s'\n", __PRETTY_FUNCTION__, name);
399 std::forward<Callable_T> (callable),
400 std::forward<Args_T> (arguments)...);
448 template <typename Callable_T, typename... Args_T>
450 Callable_T&& callable, Args_T&&... arguments)
455 if constexpr (sizeof...(arguments) == 0)
462 std::placeholders::_1,
463 std::forward<Args_T> (arguments)...);
466#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
467 trace::printf ("%s '%s' %zu\n", __PRETTY_FUNCTION__, name, own_index_);
479#pragma GCC diagnostic pop
480#pragma GCC diagnostic pop
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.17.0.