micro-test-plus
5.0.1
µTest++ Testing Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
runner-totals-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
* Major parts of the code are inspired from v1.1.8 of the Boost UT project,
12
* released under the terms of the Boost Version 1.0 Software License,
13
* which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14
*/
15
16
// ----------------------------------------------------------------------------
17
33
34
#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_RUNNER_TOTALS_INLINES_H_
35
#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_RUNNER_TOTALS_INLINES_H_
36
37
// ----------------------------------------------------------------------------
38
39
#if defined(__cplusplus)
40
41
// ----------------------------------------------------------------------------
42
43
#if defined(__GNUC__)
44
#pragma GCC diagnostic push
45
46
#if defined(__clang__)
47
#pragma clang diagnostic ignored "-Wc++98-compat"
48
#endif
// defined(__clang__)
49
#endif
// defined(__GNUC__)
50
51
// ============================================================================
52
53
namespace
micro_os_plus::micro_test_plus::detail
54
{
55
// ==========================================================================
56
61
inline
void
62
runner_totals::increment_successful_checks
(
size_t
count)
noexcept
63
{
64
successful_checks_
+= count;
65
}
66
71
inline
void
72
runner_totals::increment_failed_checks
(
size_t
count)
noexcept
73
{
74
failed_checks_
+= count;
75
}
76
81
inline
void
82
runner_totals::increment_executed_subtests
(
size_t
count)
noexcept
83
{
84
executed_subtests_
+= count;
85
}
86
91
inline
size_t
92
runner_totals::successful_checks
() const noexcept
93
{
94
return
successful_checks_
;
95
}
96
101
inline
size_t
102
runner_totals::failed_checks
() const noexcept
103
{
104
return
failed_checks_
;
105
}
106
111
inline
size_t
112
runner_totals::executed_checks
() const noexcept
113
{
114
return
successful_checks_
+
failed_checks_
;
115
}
116
121
inline
size_t
122
runner_totals::executed_subtests
() const noexcept
123
{
124
return
executed_subtests_
;
125
}
126
132
inline
bool
133
runner_totals::was_successful
(
void
)
const
noexcept
134
{
135
return
failed_checks_
== 0;
136
}
137
138
// --------------------------------------------------------------------------
139
}
// namespace micro_os_plus::micro_test_plus::detail
140
141
// ----------------------------------------------------------------------------
142
143
#if defined(__GNUC__)
144
#pragma GCC diagnostic pop
145
#endif
// defined(__GNUC__)
146
147
// ----------------------------------------------------------------------------
148
149
#endif
// defined(__cplusplus)
150
151
// ----------------------------------------------------------------------------
152
153
#endif
// MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_RUNNER_TOTALS_INLINES_H_
154
155
// ----------------------------------------------------------------------------
micro_os_plus::micro_test_plus::detail::runner_totals::increment_successful_checks
void increment_successful_checks(size_t count=1) noexcept
Increments the successful-checks counter.
Definition
runner-totals-inlines.h:62
micro_os_plus::micro_test_plus::detail::runner_totals::successful_checks_
size_t successful_checks_
Total number of successful checks.
Definition
runner-totals.h:223
micro_os_plus::micro_test_plus::detail::runner_totals::executed_subtests
size_t executed_subtests() const noexcept
Returns the number of subtests that were executed.
Definition
runner-totals-inlines.h:122
micro_os_plus::micro_test_plus::detail::runner_totals::successful_checks
size_t successful_checks() const noexcept
Returns the number of checks that passed.
Definition
runner-totals-inlines.h:92
micro_os_plus::micro_test_plus::detail::runner_totals::was_successful
bool was_successful(void) const noexcept
Checks whether all executed checks were successful.
Definition
runner-totals-inlines.h:133
micro_os_plus::micro_test_plus::detail::runner_totals::increment_executed_subtests
void increment_executed_subtests(size_t count=1) noexcept
Increments the executed-subtests counter.
Definition
runner-totals-inlines.h:82
micro_os_plus::micro_test_plus::detail::runner_totals::failed_checks_
size_t failed_checks_
Total number of failed checks.
Definition
runner-totals.h:228
micro_os_plus::micro_test_plus::detail::runner_totals::executed_subtests_
size_t executed_subtests_
Total number of tests executed.
Definition
runner-totals.h:233
micro_os_plus::micro_test_plus::detail::runner_totals::increment_failed_checks
void increment_failed_checks(size_t count=1) noexcept
Increments the failed-checks counter.
Definition
runner-totals-inlines.h:72
micro_os_plus::micro_test_plus::detail::runner_totals::failed_checks
size_t failed_checks() const noexcept
Returns the number of checks that failed.
Definition
runner-totals-inlines.h:102
micro_os_plus::micro_test_plus::detail::runner_totals::executed_checks
size_t executed_checks() const noexcept
Returns the total number of checks executed.
Definition
runner-totals-inlines.h:112
micro_os_plus::micro_test_plus::detail
Internal implementation details for the µTest++ framework.
Definition
deferred-reporter.h:88
include
micro-os-plus
micro-test-plus
inlines
runner-totals-inlines.h
Generated by
1.17.0