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

README.md

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 MakefileWorkerOverrides.mk, 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
TARGET_PLATFORM ?= 

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 https://github.com/ARMmbed/littlefs.git
$ cd tests
$ make
You can’t perform that action at this time.