micro-test-plus
6.0.0
µTest++ Testing Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
counters.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
12
// ----------------------------------------------------------------------------
13
31
32
// ----------------------------------------------------------------------------
33
34
#include "
micro-os-plus/micro-test-plus/counters.h
"
35
#include "
micro-os-plus/micro-test-plus/detail.h
"
36
37
#if __has_include("micro-os-plus/diag/trace.h")
38
#include "micro-os-plus/diag/trace.h"
39
#endif
// __has_include("micro-os-plus/diag/trace.h")
40
41
// ----------------------------------------------------------------------------
42
43
#if defined(__GNUC__)
44
#if defined(__clang__)
45
#pragma clang diagnostic ignored "-Wunknown-warning-option"
46
#pragma clang diagnostic ignored "-Wc++98-compat"
47
#pragma clang diagnostic ignored "-Wpre-c++17-compat"
48
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
49
#endif
// defined(__clang__)
50
#endif
// defined(__GNUC__)
51
52
// ============================================================================
53
54
#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
55
56
// ----------------------------------------------------------------------------
57
58
namespace
micro_os_plus::micro_test_plus
59
{
60
// ==========================================================================
61
70
counters
&
71
counters::operator+=
(
const
counters
& other)
noexcept
72
{
73
passed_checks_
+= other.passed_checks ();
74
failed_checks_
+= other.failed_checks ();
75
executed_test_cases_
+= other.executed_test_cases ();
76
failed_test_cases_
+= other.failed_test_cases ();
77
skipped_test_cases_
+= other.skipped_test_cases ();
78
79
#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
80
trace::printf (
"%s -> +%"
MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
81
" -%"
MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
82
" in xs%"
MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
83
" -xs%"
MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
"\n"
,
84
__PRETTY_FUNCTION__,
passed_checks_
,
failed_checks_
,
85
executed_test_cases_
,
failed_test_cases_
);
86
#endif
// MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED
87
88
return
*
this
;
89
}
90
91
// --------------------------------------------------------------------------
92
}
// namespace micro_os_plus::micro_test_plus
93
94
// ----------------------------------------------------------------------------
95
96
#endif
// defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
97
98
// ----------------------------------------------------------------------------
micro_os_plus::micro_test_plus::counters
Aggregated check and test case counters for a node in the test tree.
Definition
counters.h:123
micro_os_plus::micro_test_plus::counters::failed_test_cases_
size_t failed_test_cases_
Total number of executed test cases that failed.
Definition
counters.h:506
micro_os_plus::micro_test_plus::counters::counters
counters(void)=default
Default constructor.
micro_os_plus::micro_test_plus::counters::skipped_test_cases_
size_t skipped_test_cases_
Total number of test cases skipped by the filter.
Definition
counters.h:516
micro_os_plus::micro_test_plus::counters::passed_checks_
size_t passed_checks_
Total number of passed checks.
Definition
counters.h:477
micro_os_plus::micro_test_plus::counters::executed_test_cases_
size_t executed_test_cases_
Total number of test cases executed.
Definition
counters.h:494
micro_os_plus::micro_test_plus::counters::failed_checks_
size_t failed_checks_
Total number of failed checks.
Definition
counters.h:485
micro_os_plus::micro_test_plus::counters::operator+=
counters & operator+=(const counters &other) noexcept
Accumulates the totals from another instance into this one.
Definition
counters.cpp:71
counters.h
C++ header file with declarations for the µTest++ counters.
detail.h
C++ header file with declarations for the µTest++ internals.
MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
#define MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
Portable printf() conversion for the size_t values.
Definition
detail.h:102
micro_os_plus::micro_test_plus
Primary namespace for the µTest++ testing framework.
Definition
check-result.h:76
src
counters.cpp
Generated by
1.18.0