TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 228 subscribers
Post #24082 30
mimic++ v9 — A flexible, header-only mocking framework for modern C++

Hey everyone, it’s been a while since my last update — but I’m happy to share that mimic++ v9 is now live!

🔗 GitHub: github.com/DNKpp/mimicpp

⚙️ Try it instantly on Compiler Explorer: godbolt.org/z/4o4Wq5c8q

For those who haven’t seen it before:
mimic++ is a flexible, header-only mocking framework for C++20. It emphasizes compile-time safety and minimal reliance on macros letting you write expressive tests with (mostly) pure C++.


### Facade Macros.
A brand-new set of (optional) facade macros now lets you generate real C++ functions that forward to mimicpp::Mock objects.
That means much less manual boilerplate — you can quickly mock APIs by reusing mimicpp::Mock as a base building block.

### Enhanced Diagnostic
Several concept-based constraints were replaced by carefully crafted static_asserts with clearer messages, which also provide links to the documentation.
These error messages are now unit-tested to ensure they stay readable!
If you’re curious how that works, I wrote a short article about Robust compile-error tests with CMake.

### The Stacktrace-Integraiton
The optional stacktrace feature has been reworked and will likely graduate from “experimental” next release.
You can integrate it with:
- std::stacktrace
- cpptrace
- boost::stacktrace

…or provide your own custom backend with minimal effort.

### Groundwork for C++ Modules
Experimental support for C++20 modules has landed.
It’s not yet fully portable, but the foundation is there — currently working in a few select compiler environments.

### Closing Thoughts
This release focuses on making mimic++ developer-friendly, especially around diagnostics and setup.
If you’ve been waiting for a good moment to try it — this is probably it. 🙂

I’d love feedback, especially from people who’ve tried other mocking frameworks in real projects.

https://redd.it/1oa9s88
@r_cpp
GitHub GitHub - DNKpp/mimicpp: A modern and (mostly) macro free mocking-framework A modern and (mostly) macro free mocking-framework - DNKpp/mimicpp
More from @r_cpp
  1. Oct 14, 2026I tested whether a coding agent would use C++23 ranges without being told Blog post: https…
  2. Oct 14, 2026C++ futures part 1: The mental model https://devblogs.microsoft.com/oldnewthing/20261012-0…
  3. Oct 14, 2026C++ futures part 2: The mental model for std::promise, std::packaged_task https://devblogs…
  4. Oct 12, 2026[Release] slick-logger v2.2.0 — Lock-free asynchronous C++20 logging with multi-process sh…
  5. Oct 12, 2026Cheap alternative to reboot parameters (nohz, rcu, isolcpus) for stable benchmarks When no…
  6. Oct 12, 2026This C++ drama is crazy - Adobe votes no https://www.youtube.com/watch?v=DEqx_NMMH9Q https…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →