Unity Test from ThrowTheSwitch.org supplies portable C assertions and test runners aimed at microcontrollers and embedded toolchains.
Overview
Unity is a unit testing framework written in C and distributed as a compact set of source files and headers. It targets embedded firmware and other constrained environments where a small footprint and broad compiler support matter more than heavy test harnesses.
Tests use `TEST_ASSERT` macros for booleans, integers, hex values, floats, arrays, strings, and memory comparisons, with variants for sized integer types. The project ships documentation on getting started, assertion reference, and integration with companion tools such as CMock and the Ceedling build orchestrator.
Because it is source-level, you can drop Unity into Make, CMake, or custom embedded build flows and run on hosts or on-device with the compiler of your choice. ThrowTheSwitch.org also provides community forums, professional support offerings, and training focused on test-driven development for firmware teams.
Unity emphasizes reliability for safety-critical and long-lived embedded products, with examples spanning tiny MCUs to 64-bit hosts.
Key features
- Single-file friendly C framework
- Rich integer and float assertions
- Array and memory comparison macros
- Works with many embedded compilers
- Pairs with CMock and Ceedling
- Documentation for TDD workflows
- ThrowTheSwitch community support
- Optional professional certification plugins
Use cases
- Unit testing microcontroller firmware
- Adding assertions to legacy C codebases
- Running tests in CI for embedded projects
- Teaching test-driven development in C
- Combining with Ceedling for build automation