• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DNKpp / mimicpp / 18388726968

09 Oct 2025 08:46PM UTC coverage: 92.629% (-5.5%) from 98.112%
18388726968

Pull #138

github

web-flow
Merge b67d4c028 into 798c20ab0
Pull Request #138: CI: Use latest gcovr

1797 of 2079 branches covered (86.44%)

Branch coverage included in aggregate %.

2413 of 2466 relevant lines covered (97.85%)

7268.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
/include/mimic++/reporting/CallReport.hpp
1
//          Copyright Dominic (DNKpp) Koepke 2024 - 2025.
2
// Distributed under the Boost Software License, Version 1.0.
3
//    (See accompanying file LICENSE_1_0.txt or copy at
4
//          https://www.boost.org/LICENSE_1_0.txt)
5

6
#ifndef MIMICPP_REPORTING_CALL_REPORT_HPP
7
#define MIMICPP_REPORTING_CALL_REPORT_HPP
8

9
#pragma once
10

11
#include "mimic++/Call.hpp"
12
#include "mimic++/Fwd.hpp"
13
#include "mimic++/config/Config.hpp"
14
#include "mimic++/printing/StatePrinter.hpp"
15
#include "mimic++/reporting/TargetReport.hpp"
16
#include "mimic++/reporting/TypeReport.hpp"
17
#include "mimic++/utilities/SourceLocation.hpp"
18
#include "mimic++/utilities/Stacktrace.hpp"
19

20
#ifndef MIMICPP_DETAIL_IS_MODULE
21
    #include <tuple>
22
    #include <utility>
23
    #include <vector>
24
#endif
25

26
MIMICPP_DETAIL_MODULE_EXPORT namespace mimicpp::reporting
27
{
28
    /**
29
     * \defgroup REPORTING_REPORTS reports
30
     * \ingroup REPORTING
31
     * \brief Contains reports of ``mimic++`` types.
32
     * \details Reports are simplified object representations of ``mimic++`` types. In fact, reports are used to communicate with
33
     * independent domains (e.g. unit-test frameworks) over the ``IReporter`` interface and are thus designed to provide as much
34
     * transparent information as possible, without requiring them to be a generic type.
35
     *
36
     * \{
37
     */
38

39
    /**
40
     * \brief Contains the extracted info from a typed ``call::Info``.
41
     */
42
    class CallReport
43
    {
44
    public:
45
        class Arg
46
        {
47
        public:
48
            TypeReport typeInfo;
67✔
49
            StringT stateString;
63✔
50

51
            [[nodiscard]]
52
            friend bool operator==(const Arg&, const Arg&) = default;
53
        };
54

55
        TargetReport target;
80✔
56
        TypeReport returnTypeInfo;
76✔
57
        std::vector<Arg> argDetails{};
68✔
58
        util::SourceLocation fromLoc{};
56✔
59
        util::Stacktrace stacktrace{};
52✔
60
        ValueCategory fromCategory{};
52✔
61
        Constness fromConstness{};
44✔
62

63
        [[nodiscard]]
64
        friend bool operator==(CallReport const&, CallReport const&) = default;
65
    };
66

67
    /**
68
     * \brief Generates the call report for a given call info.
69
     * \tparam Return The function return type.
70
     * \tparam Params The function parameter types.
71
     * \param target The mock-target report.
72
     * \param callInfo The call info.
73
     * \param stacktrace The stacktrace, from where the call originates.
74
     * \return The call report.
75
     * \relatesalso CallReport
76
     */
77
    template <typename Return, typename... Params>
78
    [[nodiscard]]
79
    CallReport make_call_report(TargetReport target, call::Info<Return, Params...> callInfo, util::Stacktrace stacktrace)
80
    {
81
        return CallReport{
82
            .target{std::move(target)},
141✔
83
            .returnTypeInfo{TypeReport::make<Return>()},
127✔
84
            .argDetails = std::apply(
85
                [](auto&... args) {
×
86
                    return std::vector<CallReport::Arg>{
87
                        CallReport::Arg{
88
                                        .typeInfo = TypeReport::make<Params>(),
21✔
89
                                        .stateString = mimicpp::print(args.get())}
90
                        ...
91
                    };
86!
92
                },
93
                callInfo.args),
17✔
94
            .fromLoc{std::move(callInfo.fromSourceLocation)},
158✔
95
            .stacktrace{std::move(stacktrace)},
141✔
96
            .fromCategory{callInfo.fromCategory},
141✔
97
            .fromConstness{callInfo.fromConstness}};
158✔
98
    }
564✔
99

100
    /**
101
     * \}
102
     */
103
}
104

105
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc