micro-test-plus
5.0.1
µTest++ Testing Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
runner-totals.cpp
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
34
35
// ----------------------------------------------------------------------------
36
37
#include "
micro-os-plus/micro-test-plus/runner-totals.h
"
38
39
#if __has_include("micro-os-plus/diag/trace.h")
40
#include "micro-os-plus/diag/trace.h"
41
#endif
// __has_include("micro-os-plus/diag/trace.h")
42
43
// ----------------------------------------------------------------------------
44
45
#if defined(__GNUC__)
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 "-Wpre-c++17-compat"
50
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
51
#endif
// defined(__clang__)
52
#endif
// defined(__GNUC__)
53
54
// ============================================================================
55
56
#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
57
58
// ----------------------------------------------------------------------------
59
60
namespace
micro_os_plus::micro_test_plus::detail
61
{
62
// ===========================================================================
63
72
runner_totals
&
73
runner_totals::operator+=
(
const
runner_totals
& other)
noexcept
74
{
75
successful_checks_
+= other.successful_checks ();
76
failed_checks_
+= other.failed_checks ();
77
executed_subtests_
+= other.executed_subtests ();
78
79
#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
80
trace::printf (
"%s -> +%zu -%zu in xs%zu\n"
, __PRETTY_FUNCTION__,
81
successful_checks_
,
failed_checks_
,
executed_subtests_
);
82
#endif
// MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED
83
84
return
*
this
;
85
}
86
87
// --------------------------------------------------------------------------
88
}
// namespace micro_os_plus::micro_test_plus::detail
89
90
// ----------------------------------------------------------------------------
91
92
#endif
// defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
93
94
// ----------------------------------------------------------------------------
micro_os_plus::micro_test_plus::detail::runner_totals
Aggregated pass/fail/subtest counters for a node in the test tree.
Definition
runner-totals.h:98
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::operator+=
runner_totals & operator+=(const runner_totals &other) noexcept
Accumulates the totals from another instance into this one.
Definition
runner-totals.cpp:73
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::runner_totals
runner_totals()=default
Default constructor. All counters are zero-initialised.
micro_os_plus::micro_test_plus::detail
Internal implementation details for the µTest++ framework.
Definition
deferred-reporter.h:88
runner-totals.h
C++ header file with declarations for the µTest++ runner totals.
src
runner-totals.cpp
Generated by
1.17.0