Mimicc Release 0.11.0-rc1

Version 0.11.0-rc1 of the Mimicc toolchain is now available for download. The corresponding LLVM version is 12.0.0. Artifacts for Mac and Linux can be found on the Download page. The User Guide can be found here at mimicc.dev, or as a pdf in the release artifacts.

The changes for this release are as follows:

  • Added the getImplementation() API endpoint for function pointer mocks.
  • Added support to emit mocks for typedef function pointer declarations (i.e. in addition to function pointer global variables and fields as they exist today).
  • Separated out fatal and non-fatal errors in the mock API and runtime via the mock_fatal() and mock_failure() calls. Previously all errors were handled by mock_failure(). This enables a more seamless integration with GoogleTest among other test frameworks. An example has been added to the User Guide to demonstrate this.
  • A few minor bugfixes.

If you’re arriving here for the first time, welcome! We recommend you read the introductory notes from the first public release, or my recent post about why Mimicc exists.

Mimicc is a tool for generating mocks from C and C++ source code. It works like a compiler, taking C and C++ declarations as input and producing function definitions as output, either pre-compiled as an object file, or as plain C/C++. For each Mimicc-generated mock, there is also an API which allows you to interact with its functions and methods at runtime for writing unit tests.

Mimicc is distributed as a complete, stand-alone, clang-based toolchain including the compiler runtime and static analyzer. Convenience scripts are provided (mimicc-env) for creating a “virtual environment” in your favorite shell (similar to Python’s virtualenv), allowing you to comfortably use the Mimicc toolchain alongside any other compiler installations you already have on your system, including clang.