Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Here are two examples from the Interrupt post Embedded C/C++ Unit Testing Basics.

Initial Setup

# macOS
brew install cpputest lcov

# Ubutunu
sudo apt-get install -y cpputest lcov

In, it is also necessary to define the two values, which depend on where CppUTest was installed on the platform.

CPPUTEST_HOME ?= /usr/local/Cellar/cpputest/3.8

Minimal Example

This contains a very simple module my_sum.c which is tested by a simple test located at tests/src/test_my_sum.cpp

The tests can be run by running:

$ cd minimal/tests
$ make

Complex Example

This example includes using littlefs in a unit test so we need to clone the repository first

The tests can be run by running:

$ cd complex
$ git clone
$ cd tests
$ make
You can’t perform that action at this time.