# ThrowTheSwitch/Unity

Simple unit testing for C

Repository: https://github.com/ThrowTheSwitch/Unity
Canonical: https://ross.abutalabs.com/products/unity
Homepage: https://ThrowTheSwitch.org
Language: C
License: MIT
License Family: permissive
Topics: c, unit-testing
Last push: 2026-08-25T14:08:44+00:00

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

## Adoption (not part of the score)
Stars 5356, forks 1130 (observed 2026-08-28T04:09:15.974367+00:00)

## What it is
Unity is a lightweight unit testing framework for C, distributed as a single C file and a pair of headers with a rich set of assertion macros. It is designed to work with any compiler and build system, with particular focus on embedded toolchains and microcontroller targets.

## Use cases
- unit test C code
- test firmware for microcontrollers
- add a testing framework to an existing C build
- write xUnit-style tests in C
- run C tests with CMake or Make
- test embedded C toolchains with any compiler

## When to choose
- you need a minimal, dependency-free unit testing framework for C
- you are testing embedded or cross-compiled code with constrained toolchains
- you want tests that integrate into any existing build system
- you want a mature, widely adopted C test framework

## When to avoid
- you are testing C++ and want a native C++ framework like GoogleTest or Catch2
- you want automatic mocking - pair it with CMock or use Ceedling instead
- you need built-in test discovery or a test runner UI out of the box

## Facets
- artifact type: library
- maturity: stable
- function: testing, developer-tools
- domain: testing, embedded-systems, developer-tools, cross-platform
- platform: c, cpp, embedded, cross-platform, cli
- tags: unit-testing, c-testing, embedded-testing, xunit, assertions, single-file-library, microcontrollers

## Member repositories
- ThrowTheSwitch/Unity (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:15.974367+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-29T17:58:46.983209+00:00, confidence not recorded.
  - readme: https://github.com/ThrowTheSwitch/Unity (fetched 2026-08-28T04:09:15.974367+00:00, sha 8724aa0a1d18)
  - homepage: https://ThrowTheSwitch.org (fetched 2026-08-29T08:53:04.080145+00:00, sha 18a88e514e0d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
