Skip to content

Releases: DNKpp/mimicpp

v9.2.1

04 Dec 07:52

Choose a tag to compare

Fixed

  • Sequences reliably report their current head.
    In cases where min and max times where equal, expectations incorrectly reported their state as satisfied instead of saturated, which then lead to an incorrect head in sequences.

Changes

  • Upgraded bundled cpptrace dependency 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

01 Dec 13:07

Choose a tag to compare

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_key
  • expect::any_times policy
  • util::type_list_index_of trait

Fixed

  • Fixed the table of content on the doxygen-documentation mainpage
  • Fixed possible compile-error during Mock construction with gcc-10

Full Changelog: v9.1.0...v9.2.0

v9.1.0 - mimic++ officially complies with semantic-versioning

20 Oct 17:30

Choose a tag to compare

Changes

With this release, mimic++ officially complies with semantic versioning, ensuring a consistent and predictable versioning strategy.

Fixes

  • Updated internal find_package calls for fmt and cpptrace to support both MODULE and CONFIG package scripts.
    Previously, restricting these calls to CONFIG mode caused issues for users attempting to reuse existing packages provided as MODULE scripts.

Full Changelog: v9...v9.1.0

v9 - New facade facilities and more!

18 Oct 17:27

Choose a tag to compare

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

v8 - Enhanced compiler compatibility

27 Jun 16:13

Choose a tag to compare

Additions

  • Added MIMICPP_CONFIG_ALTERNATIVE_SOURCE_LOCATION_BACKEND config-option.
  • Added MIMICPP_CONFIG_EXPERIMENTAL_ENABLE_CXX20_MODULES__UNPORTABLE__ config-option.
  • Added settings::report_success feature toggle (off by default)
  • Added util::bit_cast, which in fact is just an alias for std::bit_cast (when available). Otherwise, a custom implementation will be used.
  • Added signature_add_const_qualifier trait
  • 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::SourceLocation has 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 sticky 3.15 before).
  • 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::SourceLocation has 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

12 May 15:17

Choose a tag to compare

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 SourceLocation wrapper.
  • 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_testable
    • util::weakly_equality_comparable_with
  • Added utility algorithms
    • util::find_closing_token
    • util::find_next_unwrapped_token
    • util::prefix_range
    • util::concat_array
    • util::binary_find
    • util::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
  • Limit file-path printing to a level of 3
  • Global reporter is now thread-safe
  • Carefully reworked all reporting messages
  • Split-up Reports.hpp and Reporter.hpp in several smaller headers and move into reporting sub-folder.
  • Added Reporting.hpp as all-in-one header for the reporting sub-folder.
  • Split-up Utilities.hpp into several smaller headers and move into utilities sub-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::backend received an additional requirement current(skip, max), which will break existing custom stacktrace integrations.

Full Changelog: v6...v7

v6

11 Jan 10:10

Choose a tag to compare

v6

Additions

  • variadic expect::args policy
  • expect::all_args policy
  • expect::never policy
  • new floating-point matchers
    • matches::NaN
    • matches::approx_abs
    • matches::approx_rel
  • experimental stacktrace support, with either
    • std::stacktrace (with c++23),
    • cpptrace or
    • 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.hpp into several headers under matchers sub-folder (breaking change)

Full Changelog: v5...v6

v5

15 Dec 19:09

Choose a tag to compare

v5

Changes

  • Use clang-format instead of resharper code-style.
  • Make ExpectationBuilder more compiler-friendly.
  • Make is_overload_set-trait more efficient.

Additions

  • Support for call-conventions (like __stdcall on windows)
    • New MIMICPP_REGISTER_CALL_CONVENTION macro
  • New signature related traits and concepts:
    • signature_call_convention(_t)-trait
    • signature_remove_call_convention(_t)-trait
    • call_convention_traits-trait
    • signature_remove_ref_qualifier(_t)-trait
    • signature_remove_const_qualifier(_t)-trait
    • signature_const_qualification(_v)-trait
    • signature_ref_qualification(_v)-trait
    • signature_is_noexcept(_v)-trait
    • has_default_call_convention-concept
  • Added some 32bit configurations to the build-pipeline

Fixes

  • Apply correct width, when printing pointers in 32bit builds.
  • MIMICPP_MOCK_METHOD handles parenthesized return types correctly (see issue #75 )
  • MIMICPP_MOCK_METHOD correctly expands parameter-packs (see issue #76 )
  • MIMICPP_MOCK_METHOD respects the ref-ness of the mocked function (see issue #77 )

Full Changelog: v4...v5

v4

25 Oct 15:14

Choose a tag to compare

v4

Changes

  • Print support for pointer-types (and std::nullptr_t)
  • New matches::instance matcher
  • New matches::range::each_element matcher
  • New matches::range::any_element matcher
  • Doctest Test-Framework-Adapter
  • DefaultReporter writes failures to std::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

Full Changelog: v3...v4

v3

12 Oct 18:37

Choose a tag to compare

v3

What's Changed

  • Replace optional cpp-unicodelib dependency with uni-algo
  • Printable std::optional and std::nullopt_t
  • Printable tuple-likes
  • Use matches::str::eq for 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