micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
reporter-inlines.h
Go to the documentation of this file.
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// ----------------------------------------------------------------------------
std::string buffer_
Output accumulation buffer.
Definition reporter.h:1294
const micro_test_plus::verbosity verbosity_
The verbosity level for test reporting.
Definition reporter.h:1273
auto verbosity(void) const noexcept -> micro_test_plus::verbosity
Deprecated access to the verbosity level.
reporter & operator<<(std::string_view sv)
Output operator for std::string_view.
Definition reporter.cpp:677
reporter(const runner_options &opts)
Constructor for the reporter class.
Definition reporter.cpp:162
verbosity
The verbosity levels for test reporting.
Internal implementation details for the µTest++ framework.
void append_number(std::string &buffer, T v)
Appends the shortest decimal representation of a numeric value to a buffer.
void append_pointer(std::string &buffer, T *v)
Appends the hexadecimal address of a pointer to a buffer.
indentation indent(size_t level)
Factory function that creates an indentation manipulator.
Parameterised stream manipulator for outputting indentation.
Definition reporter.h:127