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 defined(MICRO_OS_PLUS_INCLUDE_CONFIG_H)
38#include <micro-os-plus/config.h>
39#endif // MICRO_OS_PLUS_INCLUDE_CONFIG_H
40
41#if defined(MICRO_OS_PLUS_TRACE)
42#include <micro-os-plus/diag/trace.h>
43#endif // MICRO_OS_PLUS_TRACE
44
46
47// ----------------------------------------------------------------------------
48
49#if defined(__GNUC__)
50#if defined(__clang__)
51#pragma clang diagnostic ignored "-Wc++98-compat"
52#pragma clang diagnostic ignored "-Wpre-c++17-compat"
53#endif
54#endif
55
56// ============================================================================
57
59{
60 // ===========================================================================
61
72 {
73 successful_checks_ += other.successful_checks ();
74 failed_checks_ += other.failed_checks ();
75 executed_subtests_ += other.executed_subtests ();
76
77#if defined(MICRO_OS_PLUS_TRACE) \
78 && defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
79#if defined(__GNUC__)
80#pragma GCC diagnostic push
81#if defined(__clang__)
82#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
83#endif
84#endif
85 trace::printf ("%s -> +%zu -%zu in xs%zu\n", __PRETTY_FUNCTION__,
87#if defined(__GNUC__)
88#pragma GCC diagnostic pop
89#endif
90#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
91
92 return *this;
93 }
94
95 // --------------------------------------------------------------------------
96} // namespace micro_os_plus::micro_test_plus::detail
97
98// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.