micro-test-plus
6.0.0
µTest++ Testing Framework
Toggle main menu visibility
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
55
namespace
micro_os_plus::micro_test_plus::detail
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>)
79
reporter
&
80
reporter::operator<< (T* v)
81
{
82
detail::append_pointer
(
buffer_
, v);
83
return
*
this
;
84
}
85
94
template
<
class
T>
95
requires
std::is_arithmetic_v<T>
96
reporter
&
97
reporter::operator<<
(T v)
98
{
99
detail::append_number
(
buffer_
, v);
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
110
reporter::verbosity
(
void
)
const
noexcept
->
micro_test_plus::verbosity
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
// ----------------------------------------------------------------------------
micro_os_plus::micro_test_plus::detail::reporter::buffer_
std::string buffer_
Output accumulation buffer.
Definition
reporter.h:1294
micro_os_plus::micro_test_plus::detail::reporter::verbosity_
const micro_test_plus::verbosity verbosity_
The verbosity level for test reporting.
Definition
reporter.h:1273
micro_os_plus::micro_test_plus::detail::reporter::verbosity
auto verbosity(void) const noexcept -> micro_test_plus::verbosity
Deprecated access to the verbosity level.
Definition
reporter-inlines.h:110
micro_os_plus::micro_test_plus::detail::reporter::operator<<
reporter & operator<<(std::string_view sv)
Output operator for std::string_view.
Definition
reporter.cpp:677
micro_os_plus::micro_test_plus::detail::reporter::reporter
reporter(const runner_options &opts)
Constructor for the reporter class.
Definition
reporter.cpp:162
micro_os_plus::micro_test_plus::verbosity
verbosity
The verbosity levels for test reporting.
Definition
runner-options.h:101
micro_os_plus::micro_test_plus::detail
Internal implementation details for the µTest++ framework.
Definition
check-result.h:82
micro_os_plus::micro_test_plus::detail::append_number
void append_number(std::string &buffer, T v)
Appends the shortest decimal representation of a numeric value to a buffer.
Definition
detail-inlines.h:1348
micro_os_plus::micro_test_plus::detail::append_pointer
void append_pointer(std::string &buffer, T *v)
Appends the hexadecimal address of a pointer to a buffer.
Definition
detail-inlines.h:1454
micro_os_plus::micro_test_plus::detail::indent
indentation indent(size_t level)
Factory function that creates an indentation manipulator.
Definition
reporter-inlines.h:64
micro_os_plus::micro_test_plus::detail::indentation
Parameterised stream manipulator for outputting indentation.
Definition
reporter.h:127
include
micro-os-plus
micro-test-plus
inlines
reporter-inlines.h
Generated by
1.18.0