Skip to content

v9 - New facade facilities and more!

Choose a tag to compare

@DNKpp DNKpp released this 18 Oct 17:27
· 284 commits to main since this release

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::stacktrace integration (users still need to manually fetch Boost).
  • Added settings::stacktrace_base_skip.
  • Added mimicpp::util::StaticString utility.
  • Added several signatrue related traits
    • mimicpp::signature_add_lvalue_ref_qualifier
    • mimicpp::signature_add_rvalue_ref_qualifier
    • mimicpp::signature_prepend_param

Changes

  • matches::instance allowes type-hierarchies.
  • Re-designed the inner mechanics of mimicpp::util::Stacktrace (formerly known as mimicpp::Stacktrace).
  • Re-worked mimic++'s clang-format file (thanks to @2LoS for that contribution).
  • Re-worked the mimicpp::is_overload_set trait and enhanced efficiency.
  • Deprecated (MIMICPP_)MOCK_METHOD and (MIMICPP_)MOCK_OVERLOADED_METHOD.
  • Deprecated mimicpp::SequenceT in favor of mimicpp::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 a Catch::TestFailureException is thrown within a noexcept function.
    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

  • @2LoS made their first contribution in #128

Full Changelog: v8...v9