Skip to main content

runner-totals.cpp File

C++ source file with implementations for the µTest++ runner totals methods. More...

Included Headers

Namespaces Index

namespacemicro_os_plus

The primary namespace for the µOS++ framework. More...

namespacemicro_test_plus

Primary namespace for the µTest++ testing framework. More...

namespacedetail

Internal implementation details for the µTest++ framework. More...

Description

C++ source file with implementations for the µTest++ runner totals methods.

This source file contains the implementation of the runner_totals::operator+= method, which aggregates test result counters from one runner_totals instance into another. It accumulates successful checks, failed checks, and executed subtests.

All definitions reside within the micro_os_plus::micro_test_plus namespace.

This file must be included when building the µTest++ library.

File Listing

The file content with the documentation metadata removed is:

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 Software License,
13 * which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14 */
15
16// ----------------------------------------------------------------------------
17
34
35// ----------------------------------------------------------------------------
36
37#if __has_include(<micro-os-plus/project-config.h>)
38#include <micro-os-plus/project-config.h>
39#elif __has_include(<micro-os-plus/config.h>)
40#pragma message \
41 "micro-os-plus/config.h is deprecated, rename to micro-os-plus/project-config.h and include it instead of micro-os-plus/config.h"
42#include <micro-os-plus/config.h>
43#endif // __has_include(<micro-os-plus/project-config.h>)
44
45#if __has_include(<micro-os-plus/micro-test-plus-defines.h>)
46#include <micro-os-plus/micro-test-plus-defines.h>
47#endif // __has_include(<micro-os-plus/micro-test-plus-defines.h>)
48
49#if defined(MICRO_OS_PLUS_TRACE)
50#include <micro-os-plus/diag/trace.h>
51#endif // MICRO_OS_PLUS_TRACE
52
54
55// ----------------------------------------------------------------------------
56
57#if defined(__GNUC__)
58#if defined(__clang__)
59#pragma clang diagnostic ignored "-Wunknown-warning-option"
60#pragma clang diagnostic ignored "-Wc++98-compat"
61#pragma clang diagnostic ignored "-Wpre-c++17-compat"
62#endif
63#endif
64
65// ============================================================================
66
68{
69 // ===========================================================================
70
81 {
82 successful_checks_ += other.successful_checks ();
83 failed_checks_ += other.failed_checks ();
84 executed_subtests_ += other.executed_subtests ();
85
86#if defined(MICRO_OS_PLUS_TRACE) \
87 && defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED)
88#if defined(__GNUC__)
89#pragma GCC diagnostic push
90#if defined(__clang__)
91#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
92#endif
93#endif
94 trace::printf ("%s -> +%zu -%zu in xs%zu\n", __PRETTY_FUNCTION__,
96#if defined(__GNUC__)
97#pragma GCC diagnostic pop
98#endif
99#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED
100
101 return *this;
102 }
103
104 // --------------------------------------------------------------------------
105} // namespace micro_os_plus::micro_test_plus::detail
106
107// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.