No description
  • C 57.9%
  • Ruby 24.5%
  • Assembly 9.4%
  • Tcl 7.8%
  • Batchfile 0.4%
Find a file
Mark VanderVoord d482f56066
Some checks are pending
CI / Unit Tests (push) Waiting to run
CI / Unit Tests-1 (push) Waiting to run
CI / Unit Tests-2 (push) Waiting to run
CI / Unit Tests-3 (push) Waiting to run
Protect against more function-looking macros (Fixes#502)
2026-06-19 15:58:08 -04:00
.github Update main.yml 2025-06-13 12:45:11 +02:00
config Updates for the new year 2026-01-23 11:19:02 -05:00
docs Add documentation to avoid problems like #518 and #521. 2026-06-19 13:50:21 -04:00
examples cleanup the way defines are handled in tests. 2026-05-29 16:28:57 -04:00
lib Protect against more function-looking macros (Fixes#502) 2026-06-19 15:58:08 -04:00
scripts run examples fully and pass optional yaml file to them. 2026-05-29 16:09:22 -04:00
src Fix handling of array of pointers (Fixes issue #450) 2026-06-16 18:14:51 -04:00
test Protect against more function-looking macros (Fixes#502) 2026-06-19 15:58:08 -04:00
vendor run examples fully and pass optional yaml file to them. 2026-05-29 16:09:22 -04:00
.gitattributes - Added a couple more tests to our details test 2015-12-30 16:33:33 -05:00
.gitignore Need project present before running bundler. 2021-01-16 21:21:51 -05:00
.gitmodules Update description of 'create_error_stubs' 2025-06-11 12:55:28 +02:00
cmock.gemspec Working towards gemifying and automatically reporting version. 2024-08-01 11:47:58 -04:00
Gemfile Working towards gemifying and automatically reporting version. 2024-08-01 11:47:58 -04:00
LICENSE.txt Updates for the new year 2026-01-23 11:19:02 -05:00
meson.build Update meson.build 2020-08-06 12:39:56 -07:00
README.md 🪲 :fail_on_unexpected_calls options now insists on required :ignore plugin (#376) 2024-03-22 21:41:45 -04:00

CMock CI

CMock is a mock and stub generator and runtime for unit testing C. It's been designed to work smoothly with Unity Test, another of the embedded-software testing tools developed by ThrowTheSwitch.org. CMock automagically parses your C headers and creates useful and usable mock interfaces for unit testing. Give it a try!

If you don't care to manage unit testing builds yourself, consider checking out Ceedling, a test-centered build manager for unit testing C code.

Getting Started

Your first step is to get yourself a copy of CMock. There are a number of ways to do this:

  1. If you're using Ceedling, there is no need to install CMock. It will handle it for you.

  2. The simplest way is to grab it off github. The Github method looks something like this:

    git clone --recursive https://github.com/throwtheswitch/cmock.git

  3. You can also grab the zip file from github. If you do this, you'll also need to grab yourself a copy of Unity and CException, because github unfortunately doesn't bake dependencies into the zip files.

Contributing to this Project

If you plan to help with the development of CMock (or just want to verify that it can perform its self tests on your system) then you can grab its self-testing dependencies, then run its self-tests:

> cd cmock
> bundle install   # Ensures you have all RubyGems needed
> cd test
> rake             # Run all CMock self tests

Before working on this project, you're going to want to read our guidelines on contributing.

API Documentation