Releases: DNKpp/mimicpp
v9.2.1
Fixed
- Sequences reliably report their current head.
In cases whereminandmaxtimes where equal, expectations incorrectly reported their state assatisfiedinstead ofsaturated, which then lead to an incorrect head in sequences.
Changes
- Upgraded bundled
cpptracedependency to v1.0.4
Other Business
- Removed the temporary exclusion of the build matrix entry (clang-16, libstdc++, c++23).
- Correctly utilize the AppleClang compiler on macOS.
Full Changelog: v9.2.0...v9.2.1
v9.2.0 - Enhanced sequence diagnostic
Changes
- upgraded bundled fmt to
v12.1.0 - added clang-21 to the build pipeline
- Enhanced sequence diagnostics
In cases of a violation, sequences will provide more details about their current state,
i.e. the location of the current head expectation will be added to the output. - Slightly adjusted the output-format of source-locations and stacktrace entries
Changed the format from`path/to/location.ext`#L1337, `ret foo()`to`path/to/location.ext:1337`, `ret foo()`
Additions
util::pass_keyexpect::any_timespolicyutil::type_list_index_oftrait
Fixed
- Fixed the table of content on the doxygen-documentation mainpage
- Fixed possible compile-error during
Mockconstruction with gcc-10
Full Changelog: v9.1.0...v9.2.0
v9.1.0 - mimic++ officially complies with semantic-versioning
Changes
With this release, mimic++ officially complies with semantic versioning, ensuring a consistent and predictable versioning strategy.
Fixes
- Updated internal
find_packagecalls forfmtandcpptraceto support bothMODULEandCONFIGpackage scripts.
Previously, restricting these calls toCONFIGmode caused issues for users attempting to reuse existing packages provided asMODULEscripts.
Full Changelog: v9...v9.1.0
v9 - New facade facilities and more!
Additions
- A full new set of facade generator functions were introduced
(MIMICPP_)MAKE_FACADE_EXT(MIMICPP_)MAKE_OVERLOADED_FACADE_EXT(MIMICPP_)MAKE_MEMBER_MOCK(MIMICPP_)MAKE_OVERLOADED_MEMBER_MOCK(MIMICPP_)MAKE_MEMBER_MOCK_WITH_THIS(MIMICPP_)MAKE_OVERLOADED_MEMBER_MOCK_WITH_THIS
- Official
boost::stacktraceintegration (users still need to manually fetch Boost). - Added
settings::stacktrace_base_skip. - Added
mimicpp::util::StaticStringutility. - Added several signatrue related traits
mimicpp::signature_add_lvalue_ref_qualifiermimicpp::signature_add_rvalue_ref_qualifiermimicpp::signature_prepend_param
Changes
matches::instanceallowes type-hierarchies.- Re-designed the inner mechanics of
mimicpp::util::Stacktrace(formerly known asmimicpp::Stacktrace). - Re-worked mimic++'s clang-format file (thanks to @2LoS for that contribution).
- Re-worked the
mimicpp::is_overload_settrait and enhanced efficiency. - Deprecated
(MIMICPP_)MOCK_METHODand(MIMICPP_)MOCK_OVERLOADED_METHOD. - Deprecated
mimicpp::SequenceTin favor ofmimicpp::Sequence.
Fixes
- The official Catch2 Adapter now tries to explicitly flush Catch2's failure messages when a fatal violation occurs.
This ensures that diagnostic output is visible even if aCatch::TestFailureExceptionis thrown within anoexceptfunction.
This issue primarily impacts CLion users, and a related bug report can be found here: CPP-46474. - The package now correctly generates the target
mimicpp::mimicpp.
Removals
- The option for a custom source-location backend was removed.
Migration Guide
Deprecating (MIMICPP_)MOCK_METHOD and (MIMICPP_)MOCK_OVERLOADED_METHOD
There is no immediate requirement to update existing interface mocks; however, these macros are planned for removal in the long term.
Migrating is straightforward: simply replace (MIMICPP_)MOCK_METHOD with (MIMICPP_)MAKE_MEMBER_MOCK, and (MIMICPP_)MOCK_OVERLOADED_METHOD with (MIMICPP_)MAKE_OVERLOADED_MEMBER_MOCK.
Note that the new macros do not automatically add override, so be sure to explicitly specify it when replacing the old ones.
Custom SourceLocation backend
If you are not using a custom backend (or the provided compatibility backend), you can safely stop reading here.
The option to use a custom backend has been completely removed, since it provided little practical benefit. In almost all cases (~99%), std::source_location is used directly. The remaining few cases typically involved gcc 10 or 11 users who only needed mimic++ to work in their environment.
For those users, there’s good news: you can now remove MIMICPP_CONFIG_ALTERNATIVE_SOURCE_LOCATION_BACKEND from your CMake configuration. You can also clean up any related setup for a custom source location. mimic++ will automatically fall back to compiler-specific intrinsics when necessary.
If you encounter issues with a particular compiler or environment that I haven’t accounted for, please reach out on Discord or open an issue.
New Contributors
Full Changelog: v8...v9
v8 - Enhanced compiler compatibility
Additions
- Added
MIMICPP_CONFIG_ALTERNATIVE_SOURCE_LOCATION_BACKENDconfig-option. - Added
MIMICPP_CONFIG_EXPERIMENTAL_ENABLE_CXX20_MODULES__UNPORTABLE__config-option. - Added
settings::report_successfeature toggle (off by default) - Added
util::bit_cast, which in fact is just an alias forstd::bit_cast(when available). Otherwise, a custom implementation will be used. - Added
signature_add_const_qualifiertrait - Extended examples and documentation for custom matchers. (see
examples/CustomMatcher.cpp) - Additions to the CI/CD build-matrix
- Added gcc-10 (requires an alternative source-location backend)
- Added gcc-10.2 (which is the latest available one on Debian-11)
- Added gcc-11
Changes
- The interface of
mimicpp::util::SourceLocationhas been fully reworked. It now serves as an actual abstraction around an exchangeable source-location backend. - Changed to cmake version range
3.15...3.31(was sticky3.15before). - Upgraded optional dependency jeremy-rifkin/cpptrace to
v1.0.2. - Prefixed several custom cmake scripts with
Mimic++-to prevent potential clashes.
Breaking Changes
- The interface of
mimicpp::util::SourceLocationhas been fully reworked.
For users who do not use this type directly, there should be no noticeable changes and no required code adaptation. - The unit-test adapter headers were relocated to
mimic++_ext/adapters(note the _ext).
For users who consume any of them, the include path must be adapted accordingly.
Full Changelog: v7...v8
Highly experimental C++-20 modules
This release contains preparations for modularizing mimic++. There are some environments in the build-matrix which are actually able to successfully build and consume the mimicpp module. Nevertheless, this is highly experimental.
When MIMICPP_CONFIG_EXPERIMENTAL_ENABLE_CXX20_MODULES__UNPORTABLE__ is enabled (and a suitable compiler is targeted), the CMake target mimic++::module is defined. This target will then build the mimicpp module.
v7
Additions
mimic++has a official logo- A dedicated discord server has been created => join
- Mocks now have (customizable) names, which will also be included in the reports.
- Added thin
SourceLocationwrapper. - Added
MIMICPP_ASSERT(which does nothing by default, but is active in unit-tests and examples). - Added
stacktrace::current(skip, max)overload. - Added
ScopedSequence(in greedy and lazy flavors), which simplify setting up sequences. - Added utility concepts
util::boolean_testableutil::weakly_equality_comparable_with
- Added utility algorithms
util::find_closing_tokenutil::find_next_unwrapped_tokenutil::prefix_rangeutil::concat_arrayutil::binary_findutil::contains
- CI/CD build-matrix
- Added clang-20
- Added gcc-15
Changes
- Prettier type-printing
- Various enhancements for state-printing
- ranges are now formatted with
[]to match c++23 style - tuple-likes are not formatted with
()to match c++23 style - added support for std-smart-pointers
- ranges are now formatted with
- Limit file-path printing to a level of 3
- Global reporter is now thread-safe
- Carefully reworked all reporting messages
- Split-up
Reports.hppandReporter.hppin several smaller headers and move intoreportingsub-folder. - Added
Reporting.hppas all-in-one header for thereportingsub-folder. - Split-up
Utilities.hppinto several smaller headers and move intoutilitiessub-folder. - Policies are now allowed to provide no description.
- Matchers are now allowed to provide no description.
Breaking Changes
- Slightly reworked the
IReporter-Interface, which will require adaptation on the user-side, if custom reporters are implemented. stacktrace::backendreceived an additional requirementcurrent(skip, max), which will break existing custom stacktrace integrations.
Full Changelog: v6...v7
v6
Additions
- variadic
expect::argspolicy expect::all_argspolicyexpect::neverpolicy- new floating-point matchers
matches::NaNmatches::approx_absmatches::approx_rel
- experimental stacktrace support, with either
std::stacktrace(withc++23),cpptraceor- custom stacktrace-backends.
Others
- extend 32bit build-configs on ci/cd
- improving coverage workflow
- add CodeQL workflow
- add clang-19 to the build pipeline
- add adapter headers as release artifacts
- add Cheat-Sheet pdf as release artifact
- split-up
Matcher.hppinto several headers undermatcherssub-folder (breaking change)
Full Changelog: v5...v6
v5
Changes
- Use clang-format instead of resharper code-style.
- Make
ExpectationBuildermore compiler-friendly. - Make
is_overload_set-trait more efficient.
Additions
- Support for call-conventions (like
__stdcallon windows)- New
MIMICPP_REGISTER_CALL_CONVENTIONmacro
- New
- New signature related traits and concepts:
signature_call_convention(_t)-traitsignature_remove_call_convention(_t)-traitcall_convention_traits-traitsignature_remove_ref_qualifier(_t)-traitsignature_remove_const_qualifier(_t)-traitsignature_const_qualification(_v)-traitsignature_ref_qualification(_v)-traitsignature_is_noexcept(_v)-traithas_default_call_convention-concept
- Added some 32bit configurations to the build-pipeline
Fixes
- Apply correct width, when printing pointers in 32bit builds.
MIMICPP_MOCK_METHODhandles parenthesized return types correctly (see issue #75 )MIMICPP_MOCK_METHODcorrectly expands parameter-packs (see issue #76 )MIMICPP_MOCK_METHODrespects the ref-ness of the mocked function (see issue #77 )
Full Changelog: v4...v5
v4
Changes
- Print support for pointer-types (and
std::nullptr_t) - New
matches::instancematcher - New
matches::range::each_elementmatcher - New
matches::range::any_elementmatcher - Doctest Test-Framework-Adapter
DefaultReporterwrites failures tostd::cerr- Extend string customization and related documentation
Fixes
- Correct several typos in
InstallRules.cmake[see #60] (thanks to @nickdademo für pointing this out)
Others
mimic++is now officially available on godbolt.org
Full Changelog: v3...v4
v3
What's Changed
- Replace optional
cpp-unicodelibdependency withuni-algo - Printable
std::optionalandstd::nullopt_t - Printable tuple-likes
- Use
matches::str::eqfor string arguments when in-place expectation is used - Lifetime-Watcher
- RelocationWatcher
- Enable heavy warnings and treat them as error in test targets
- CMake Improvements (thanks to @5cript, who initiated this process)
New Contributors
Full Changelog: v2...v3