Welcome, Guest! Log In | Create Account

http://cmock.sourceforge.net/CMockLogo.png Home | Project Portal | Atomic Object | Embedded Corner | Agile Embedded Group

CMock - Mock Module Generation Framework for C

CMock is a module/object mocking framework for C projects useful for interaction-based unit testing. CMock uses Ruby to auto-generate C source code mock object modules conforming to the interfaces specified in C header files.

Automatically generated mock objects allow easy, thorough test coverage in Test-Driven Development and provide the means to efficiently execute Feature-Driven Development techniques such as Presenter First and Conductor First. Presenter First is a technique often used for creating well-tested Graphical User Interfaces. Conductor First is a technique useful for embedded systems software development (see Mocking the Embedded World).

The CMock framework is a set of Ruby scripts and relies on Rake, Ruby's Make-like facility. The auto-generated C code produced by CMock makes use of the C unit testing framework Unity and can even optionally work with exceptions via the CException project.

CMock is easily configurable by tweaking YAML files.

It comes with Ruby/Rake build examples for arbitrary toolchains, by simply modifying or creating a new YAML file for the target toolchain compiler, linker and simulator. We have included YAML configuration files for GCC, and IAR Embedded Workbench for ARM (both v4.x and v5.x). You can try out the IAR toolchain integration with either the full version of IAR EWARM or the 32kB Kickstart Edition which is available for download on the IAR website.

Helpful Information