Skip to main content

reporter-inlines.h File

C++ header file with inline implementations for the µTest++ test reporter. More...

Namespaces Index​

namespacemicro_os_plus

The primary namespace for the µOS++ framework. More...

namespacemicro_test_plus

Primary namespace for the µTest++ testing framework. More...

namespacedetail

Internal implementation details for the µTest++ framework. More...

Functions Index​

indentationindent (size_t level)

Factory function that creates an indentation manipulator. More...

Description​

C++ header file with inline implementations for the µTest++ test reporter.

This header provides the inline implementations for the test reporting facilities used within the µTest++ framework: the indent() manipulator factory, the reporter accessor, and the template output operators for pointers and arithmetic values.

All definitions reside within the micro_os_plus::micro_test_plus::detail namespace, since the reporters are internal to the framework.

This file is included by reporter.h; the applications include micro-os-plus/micro-test-plus.h, not this file.

Functions​

indent()​

indentation micro_os_plus::micro_test_plus::detail::indent (size_t level)
inline nodiscard

Factory function that creates an indentation manipulator.

Returns an indentation aggregate initialised with level.

Allows writing reporter << indent(n) instead of constructing the manipulator explicitly.

Parameters
level

The number of four-space indentation levels.

Returns

An indentation value for use with operator<<.

Definition at line 64 of file reporter-inlines.h.

64 indent (size_t level)
65 {
66 return { level };
67 }

Reference micro_os_plus::micro_test_plus::detail::indent.

Referenced by micro_os_plus::micro_test_plus::detail::reporter_human::begin_test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::begin_test_case, micro_os_plus::micro_test_plus::detail::reporter_human::display_open_heading, micro_os_plus::micro_test_plus::detail::reporter_tap::display_open_heading, micro_os_plus::micro_test_plus::detail::reporter_tap::end_suite, micro_os_plus::micro_test_plus::detail::reporter_human::end_test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::end_test_case, micro_os_plus::micro_test_plus::detail::reporter_human::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::fail_suite, micro_os_plus::micro_test_plus::detail::indent, micro_os_plus::micro_test_plus::detail::reporter_human::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_human::output_pass_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_pass_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::pass_without_text, micro_os_plus::micro_test_plus::detail::reporter_human::skip_test_case and micro_os_plus::micro_test_plus::detail::reporter_tap::skip_test_case.

File Listing​

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 */
11
12// ----------------------------------------------------------------------------
13
32
33#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_REPORTER_INLINES_H_
34#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_REPORTER_INLINES_H_
35
36// ----------------------------------------------------------------------------
37
38#if defined(__cplusplus)
39
40// ----------------------------------------------------------------------------
41
42#if defined(__GNUC__)
43#pragma GCC diagnostic push
44
45#pragma GCC diagnostic ignored "-Waggregate-return"
46#if defined(__clang__)
47#pragma clang diagnostic ignored "-Wunknown-warning-option"
48#pragma clang diagnostic ignored "-Wc++98-compat"
49#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
50#endif // defined(__clang__)
51#endif // defined(__GNUC__)
52
53// ============================================================================
54
56{
57 // --------------------------------------------------------------------------
58
63 inline indentation
64 indent (size_t level)
65 {
66 return { level };
67 }
68
69 // ==========================================================================
70
77 template <typename T>
78 requires (not std::is_same_v<T, char>)
80 reporter::operator<< (T* v)
81 {
83 return *this;
84 }
85
94 template <class T>
95 requires std::is_arithmetic_v<T>
98 {
100 return *this;
101 }
102
103#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
108 // Deprecated since 6.0.0; use runner::verbosity_level().
109 inline auto
111 {
112 return verbosity_;
113 }
114#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
115
116 // --------------------------------------------------------------------------
117} // namespace micro_os_plus::micro_test_plus::detail
118
119#if defined(__GNUC__)
120#pragma GCC diagnostic pop
121#endif // defined(__GNUC__)
122
123// ----------------------------------------------------------------------------
124
125#endif // defined(__cplusplus)
126
127// ----------------------------------------------------------------------------
128
129#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_REPORTER_INLINES_H_
130
131// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.