# google/cmockery

A lightweight library to simplify and generalize the process of writing unit tests for C applications.

Repository: https://github.com/google/cmockery
Canonical: https://ross.abutalabs.com/products/cmockery
Language: Shell
License: Apache-2.0
License Family: permissive
Topics: cmockery, c, testing, tests, mocking, mocks, unit-testing, embedded-systems
Archived: true
Last push: 2020-05-28T15:20:07+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3921, "days_push": 2288, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1086, forks 355 (observed 2026-08-28T04:03:32.161701+00:00)

## What it is
Cmockery is a lightweight C library for writing unit tests, compiled into standalone test executables linked with the code under test. It emphasizes minimal dependencies and compatibility with old compilers, making it suitable for testing exotic or embedded code.

## Use cases
- write unit tests for C code
- mock external functions in C unit tests
- test C modules with old compilers
- unit test embedded systems code
- run C tests as standalone executables

## When to choose
- you need a minimal C unit testing framework with few dependencies
- you're stuck with an old compiler that newer frameworks don't support
- you're testing embedded or exotic C code with a custom C library

## When to avoid
- you want a modern, actively developed C testing framework
- you're testing applications with the latest compilers where richer frameworks fit better
- you need features like test discovery or rich assertion reporting

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, mocking, e2e-testing
- domain: testing, developer-tools, embedded-systems
- platform: windows, cross-platform, c
- tags: unit-testing, c-unit-tests, mocking-framework, lightweight, legacy-compiler-friendly, linux

## Member repositories
- google/cmockery (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:32.161701+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:49:31.709883+00:00, confidence not recorded.
  - readme: https://github.com/google/cmockery (fetched 2026-08-28T04:03:32.161701+00:00, sha eb1f1288c5e9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
