Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

CppUTest

cpputest.github.io

  • Free plan
  • Windows
  • macOS
  • Linux
  • Self-hosted

What CppUTest is

CppUTest is a free C/C++ xUnit framework for unit testing and test-driven development, often used in embedded systems. Its design goals include simplicity and portability across old and new platforms. The framework organizes tests into groups and supports setup and teardown, with assertions for conditions, equality, strings, numbers, pointers, and memory.

CppUMock adds mocking support, and the manual describes optional Google Mock integration. CppUTest also provides macros for tests in C source files, with wrappers that register those tests with the framework. Its per-test memory leak check compares memory use before setup with usage after teardown. Plugins cover memory leak detection, pointer restoration, and floating-point exception flags. The command-line runner can emit JUnit-style XML and TeamCity XML for CI systems. Build options documented by the project include CMake or autoconf from source, Debian and Ubuntu packages, and Homebrew for macOS. It supports Linux, macOS, Windows, and self-hosted use. One build limitation is that MakefileWorker.mk is for source builds and is unsupported by pre-packaged installs.

Who it suits

CppUTest suits C and C++ developers who need unit testing and mocking, including teams working on embedded systems. It is described as suitable for C/C++ projects generally and runs across Linux, macOS, Windows, and self-hosted environments.

Good to know, and what to watch

  • Supports tests written in both C and C++.
  • Includes mocking support through CppUMock.
  • Per-test memory leak detection is available.
  • Runner can emit JUnit-style and TeamCity XML.
  • Builds are documented for several platforms and package formats.
  • MakefileWorker.mk is unsupported by pre-packaged installs.
  • Google Mock integration is optional.
  • The project lists no security certifications or compliance claims.

Free and open-source

Free

Free plan

Getting started

  1. Visit the CppUTest project website
  2. Choose a source build with CMake or autoconf, or use a Debian, Ubuntu, or Homebrew package
  3. Install on Linux, macOS, Windows, or a self-hosted environment
  4. Organize tests into groups with setup and teardown
  5. Add C or C++ assertions and CppUMock mocks
  6. Run the command-line runner and export JUnit-style or TeamCity XML

Limits to check

Pre-packaged installations do not support MakefileWorker.mk; that file is available when building from source. Google Mock support is described as optional integration.

The verdict

CppUTest offers a portable testing framework with C support, mocks, memory checks, and CI-oriented output. Choose a source build if your workflow depends on MakefileWorker.mk.

Questions people ask

What does CppUTest cost?

It is free and listed as free plan.

Which languages does it support?

CppUTest supports C and C++.

Where can it run?

The project supports Linux, macOS, Windows, and self-hosted use.

Does it include mocking?

Yes. CppUMock provides mocking, and the manual documents optional Google Mock integration.

What output can its runner produce?

The command-line runner can emit JUnit-style XML and TeamCity XML for CI systems.

How is it licensed?

The project repository identifies a BSD-3-Clause license.

What the maker publishes

Assertions and test groups
The core manual documents test groups, setup and teardown, and assertions for conditions, equality, strings, numbers, pointers, and memory. source
Assertions and test organization
The framework provides test groups, tests, setup and teardown, and assertion macros for conditions, comparisons, strings, pointers, and memory. source
Build and installation
The project documents source builds with CMake or autoconf, Debian and Ubuntu packages, and a Homebrew package for macOS. source
C interface
CppUTest provides macros for writing tests in C source files and wrappers that register those tests with CppUTest. source
CI output
The command line runner can output JUnit-style XML for CI systems and XML for TeamCity. source
Design
The project says its design goals include simplicity and portability to old and new platforms. source
Intended users
It is frequently used in embedded systems and is described as suitable for any C/C++ project. source
License
The project repository identifies its license as BSD-3-Clause. source
Memory checking
CppUTest includes per-test memory leak detection that checks whether memory use returns to its starting level after a test. source
Memory leak detection
The manual describes per-test memory leak detection that compares memory use before setup and after teardown. source
Mocking
CppUMock provides mocking support, and the manual also describes optional integration with Google Mock. source
Notable limit
The site says MakefileWorker.mk is available when building from source and is not supported by pre-packaged installs. source
Other testing integrations
The manual documents integration with Google Mock and running Google Tests alongside CppUTest tests in one binary. source
Platforms
The site documents building with Visual Studio and says CppUTest works for any C/C++ project; it also provides Linux and macOS installation instructions. source
Purpose
CppUTest is a C/C++ xUnit framework for unit testing and test-driving code, frequently used in embedded systems. source
Security and compliance
The project repository identifies a BSD-3-Clause license; the pages reviewed do not state security certifications or compliance claims. source
Support
The project site directs users with questions to Google Groups and provides a GitHub issues page for bugs and feature requests. source
Test-driven development
Its stated design principles include simplicity, portability to old and new platforms, and support for test-driven development. source
Test output
The command-line runner can emit JUnit-style XML and TeamCity XML output for CI systems. source
Test plugins
Provided plugins include memory leak detection, pointer restoration, and checks for floating-point exception flags. source

Checked against the maker's pages on 8 Oct 2026.