Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul report printing #101

Merged
merged 90 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
dfe60ef
chore: TypeReport queries the type-name lazily
DNKpp Jan 28, 2025
8e8919a
refactor: extract TypeReport into reporting/TypeReport
DNKpp Jan 28, 2025
a891e2e
refactor: extract CallReport into reporting/CallReport and put into n…
DNKpp Jan 28, 2025
68c134d
refactor: extract MatchReport and ExpectationReport and put into repo…
DNKpp Jan 28, 2025
fbbc651
refactor: split Reporter.hpp into multiple files
DNKpp Jan 28, 2025
089f944
fix: correct several compile errors
DNKpp Jan 28, 2025
4db8d40
cleanup: remove Reporter.hpp
DNKpp Jan 28, 2025
2b5abf2
cleanup: remove Reporter.hpp
DNKpp Jan 28, 2025
cfb1d2a
chore: rename Reports.hpp to Reporting.hpp
DNKpp Jan 28, 2025
9077558
fix: update test-framework adapters
DNKpp Jan 28, 2025
121744f
fix: correct compile error in InterfaceMock.hpp
DNKpp Jan 28, 2025
4c868c3
chore: rework reporting::DefaultReporter constructor
DNKpp Jan 28, 2025
33f93cb
feat: Expectation::is_applicable
DNKpp Jan 29, 2025
1982661
feat: ScopedExpectation::is_applicable
DNKpp Jan 29, 2025
52525ac
chore: change members of reporting::ExpectationReport
DNKpp Jan 30, 2025
730f95b
chore: change semantic of Expectation::matches
DNKpp Jan 30, 2025
3e278d7
chore: update IReporter
DNKpp Jan 30, 2025
05d3bf9
chore: update GlobalReporter.hpp
DNKpp Jan 30, 2025
5c9b15e
chore: update BasicReporter
DNKpp Jan 30, 2025
db27bab
chore: update GlobalReporter tests
DNKpp Jan 30, 2025
6238804
chore: update TestReporter.hpp
DNKpp Jan 30, 2025
a4e06d0
fix: update several Expectation related tests
DNKpp Jan 30, 2025
de7ec0f
cleanup: remove printer specialization for reporting::CallReport
DNKpp Jan 30, 2025
c0c1c6c
cleanup: remove printer specialization for reporting::ExpectationReport
DNKpp Jan 30, 2025
e342439
cleanup: remove obsolete stringify-functions
DNKpp Jan 30, 2025
49bbb6a
feat: new report-stringification functions
DNKpp Jan 30, 2025
70c25c5
feat: util::partition_by
DNKpp Jan 31, 2025
b1d4e04
chore: utilize util::partition_by algorithm in reporting::detail::str…
DNKpp Jan 31, 2025
b9da489
fix: make TypeReport private constructor constexpr
DNKpp Jan 31, 2025
7528a32
chore: detail::stringify_inapplicable_matches and detail::stringify_n…
DNKpp Jan 31, 2025
a9c65c8
chore: update DefaultReporter
DNKpp Jan 31, 2025
118bdcb
fix: add missing reporting::NoMatchReport type
DNKpp Jan 31, 2025
2ca0a7a
cleanup: remove outdated MatchReport
DNKpp Jan 31, 2025
c5dd20d
fix: wrap subobject in braces
DNKpp Jan 31, 2025
6fc645e
fix: remove all references to reporting::MatchReport
DNKpp Jan 31, 2025
852c1c3
fix: add missing pragma once in utilities/Regex.hpp
DNKpp Jan 31, 2025
55fe4b7
chore: simplify several designated initializer statements
DNKpp Jan 31, 2025
4597334
feat: enhance full-match stringification
DNKpp Jan 31, 2025
d25e963
fix: correct gtest adapter test
DNKpp Jan 31, 2025
246c1be
fix: incorrect .cbegin and .cend usage
DNKpp Jan 31, 2025
b4467a7
chore: adjust std::source_location formatting
DNKpp Jan 31, 2025
81225ef
chore: update stacktrace print format
DNKpp Jan 31, 2025
fab1578
chore: update stringify_full_match tests
DNKpp Jan 31, 2025
3b888f3
feat: enhance detail::stringify_full_match
DNKpp Jan 31, 2025
eddedaf
fix: mark conditionally used function as maybe_unused
DNKpp Jan 31, 2025
c907244
fix: please clang
DNKpp Jan 31, 2025
b4af0a3
refactor: rework stringify_expectation_report_requirement_description…
DNKpp Feb 2, 2025
f22aaa9
chore: enhance detail::stringify_no_matches
DNKpp Feb 2, 2025
7d13a5f
chore: rework detail::stringify_unfulfilled_expectation
DNKpp Feb 2, 2025
0e70449
cleanup: remove obsolete stringify functions
DNKpp Feb 2, 2025
8d22d64
chore: change "Call from" wording to "Call originated from"
DNKpp Feb 2, 2025
28fbee9
chore: change wording "Expectation from" to "Expectation defined at"
DNKpp Feb 2, 2025
9ccaa75
chore: adjust detail::stringify_call_report_arguments
DNKpp Feb 2, 2025
266c8ba
chore: rework detail::stringify_unhandled_exception
DNKpp Feb 2, 2025
07f6380
feat: pull stringify_full_match, stringify_inapplicable_matches, stri…
DNKpp Feb 2, 2025
4c40ce8
chore: extract reporting::NoMatchReport into its own file
DNKpp Feb 2, 2025
b9004ee
test: add tests for reporting::RequirementOutcomes
DNKpp Feb 2, 2025
d11e9c9
fix: correct BasicReporter and DefaultReporter unhandled-exception test
DNKpp Feb 2, 2025
4f8f099
docs: adjust reports documentation
DNKpp Feb 2, 2025
be6effc
chore: adjust includes of CallReport.hpp
DNKpp Feb 2, 2025
f0ce5ba
fix: correct gtest-adapter tests
DNKpp Feb 2, 2025
5b40b6a
feat: reporting::TargetReport
DNKpp Feb 2, 2025
8a1f3bc
feat: util::SourceLocation
DNKpp Feb 3, 2025
c212790
chore: Expectation stores a util::SourceLocation
DNKpp Feb 3, 2025
e612c4b
chore: replace several raw std::source_location members with util::So…
DNKpp Feb 3, 2025
8e61136
chore: ExpectationBuilder makes use of reporting::TargetReport
DNKpp Feb 3, 2025
8ea2baa
chore: Expectation utilizes reporting::TargetReport
DNKpp Feb 3, 2025
3065a43
chore: reporting::ExpectationReport stores TargetReport and util::Sou…
DNKpp Feb 3, 2025
f2ae13a
chore: change Expectation::from return type to util::SourceLocation c…
DNKpp Feb 3, 2025
459c2ab
chore: remove expectation_info member from BasicExpectation
DNKpp Feb 3, 2025
ca0fe06
cleanup: remove expectation_info
DNKpp Feb 3, 2025
8229a80
cleanup: remove is_same_source_location
DNKpp Feb 3, 2025
e59befb
chore: add reporting::TargetReport param to ExpectationCollection::ha…
DNKpp Feb 3, 2025
f151959
chore: add reporting::TargetReport member to reporting::CallReport
DNKpp Feb 3, 2025
2f5423d
chore: apply syntax style on GlobalReporter.cpp
DNKpp Feb 3, 2025
391c878
chore: apply code style on Mock.cpp
DNKpp Feb 3, 2025
4509dbb
test: add tests for overload-target reports
DNKpp Feb 3, 2025
5316c77
chore: update call-convention macro
DNKpp Feb 3, 2025
8b4623a
feat: add target statement to report stringifications
DNKpp Feb 3, 2025
2cbc059
fix: update GccCallConvention tests
DNKpp Feb 3, 2025
7a3a905
test: extend stringify_unfulfilled_expectation cases
DNKpp Feb 3, 2025
d0bbc72
chore: remove descriptions.empty branch in stringify_expectation_repo…
DNKpp Feb 3, 2025
4bc4ddb
fix: interface-mocks utilizes print_type for name-generation
DNKpp Feb 3, 2025
c64f231
feat: reporting::stringify_unhandled_exception adds stacktrace if exi…
DNKpp Feb 3, 2025
0d21b12
fix: mark constant as maybe-unused
DNKpp Feb 3, 2025
1de71f3
docs: update reporting documentation
DNKpp Feb 3, 2025
bbe7ade
fix: store global reporter in a atomic<std::shared_ptr>
DNKpp Feb 3, 2025
b0defb2
fix: relax interface-mock name test case to match gcc's and clang's r…
DNKpp Feb 3, 2025
96312ce
fix: utilize older atomic-shared_ptr free-functions for libc++
DNKpp Feb 3, 2025
1a18152
chore: apply code style on adapter-headers
DNKpp Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/mimic++/Call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "mimic++/Fwd.hpp"
#include "mimic++/Stacktrace.hpp"
#include "mimic++/TypeTraits.hpp"
#include "mimic++/utilities/SourceLocation.hpp"

#include <source_location>
#include <tuple>
#include <utility>

Expand All @@ -27,7 +27,7 @@ namespace mimicpp::call
ArgListT args;
ValueCategory fromCategory{};
Constness fromConstness{};
std::source_location fromSourceLocation{};
util::SourceLocation fromSourceLocation{};
Stacktrace stacktrace{stacktrace::NullBackend{}};
};

Expand Down
32 changes: 18 additions & 14 deletions include/mimic++/CallConvention.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "mimic++/Fwd.hpp"
#include "mimic++/TypeTraits.hpp"
#include "mimic++/reporting/TargetReport.hpp"

#include <concepts>
#include <source_location>
Expand Down Expand Up @@ -85,20 +86,23 @@ namespace mimicpp
* \param call_convention The used call-convention.
* \param specs All other function specifications (e.g. ``const`` and ``noexcept``).
*/
#define MIMICPP_DETAIL_DEFINE_CALL_CONVENTION_CALL_INTERFACE(call_convention, specs) \
template <typename Derived, typename Return, typename... Params> \
class CallInterface< \
Derived, \
Return call_convention(Params...) specs> \
{ \
public: \
constexpr Return call_convention operator()( \
Params... params, \
const ::std::source_location& from = ::std::source_location::current()) specs \
{ \
return static_cast<const Derived&>(*this) \
.handle_call(::std::tuple{::std::ref(params)...}, from); \
} \
#define MIMICPP_DETAIL_DEFINE_CALL_CONVENTION_CALL_INTERFACE(call_convention, specs) \
template <typename Derived, typename Return, typename... Params> \
class CallInterface< \
Derived, \
Return call_convention(Params...) specs> \
{ \
public: \
constexpr Return call_convention operator()( \
Params... params, \
::std::source_location from = ::std::source_location::current()) specs \
{ \
return static_cast<Derived const&>(*this) \
.handle_call( \
::mimicpp::reporting::TypeReport::make<Return(Params...) specs>(), \
::std::tuple{::std::ref(params)...}, \
::std::move(from)); \
} \
}

/**
Expand Down
Loading
Loading