CMock
Mock/stub generator for C
Install / Use
/learn @ThrowTheSwitch/CMockREADME
CMock 
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:
-
If you're using Ceedling, there is no need to install CMock. It will handle it for you.
-
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
-
You can also grab the
zipfile 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
- Not sure what you're doing?
- Interested in our MIT license?
- Are there examples?
- They are all in /examples
- Any other resources to check out?
- Definitely! Check out our developer portal on ThrowTheSwitch.org
Related Skills
gh-issues
337.3kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
83.2kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
