cmocka
« Back to VersTracker
Description:
Unit testing framework for C
Type: Formula  |  Latest Version: 2.0.0@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: testing c unit-testing framework mocking
Install: brew install cmocka
About:
cmocka is a lightweight unit testing framework for C with a focus on simplicity and ease of integration. It provides a clean API for writing test cases, mocks, and assertions, inspired by the Google Test framework. Its minimal dependencies and straightforward setup make it ideal for testing C libraries and applications.
Key Features:
  • Lightweight with minimal dependencies
  • Supports mocking of functions and global state
  • Provides rich assertion macros
  • Test fixtures for setup and teardown
  • Memory leak detection
Use Cases:
  • Unit testing C libraries and applications
  • Testing code with complex dependencies using mocks
  • Verifying memory management and leak detection
Alternatives:
  • Check – More mature but has a more complex API and runtime requirements
  • Google Test (gtest) – C++ focused with heavier dependencies, not native to C
Version History
Detected Version Rev Change Commit