blob: 32b066a1d510f794ff3f8b2ac249125fc231f4a5 [file] [log] [blame]
Imre Kisa21712e2019-10-08 12:56:59 +02001Welcome to the Firmware Test Builds's documentation!
2====================================================
3
4.. toctree::
5 :maxdepth: 1
6 :hidden:
7 :numbered:
8
9 Home<self>
10 user_guide
11 implementing_tests
12 components/index
13 project/index
14
15This repository contains the unit testing framework.
16
17These tests are meant to run on host machine and used to cover platform independent code on the unit test level. In this case a
18unit is considered to be a C function or couple related functions. Each unit test suite compiles into a binary which can be run
19and debugged as any ordinary executable.
20
21The system uses CppUTest as unit testing framework. The tests are written in C++ in order to be able to use CppUTests' all
22useful features like the automatic collection of test cases and the CppUMock mocking system.
23
24Separating dependencies apart from the code under test is a crutial step in unit testing systems. In many cases this can be
25easily done by linking mocked functions to the tested code but sometimes it's difficult like when the code under test and its
26dependencies are in the same compilation unit. For separating the code under test from its dependencies a tool called c-picker
27can be used. It can pick pieces of code (functions, variables, etc.) based on descriptor files.
28
29The build system is based on CMake. The repository contains CMake modules for defining unit test suites. It also invokes
30c-picker if a descriptor file is listed among the test sources. CMake has a built in test driver system called ctest. It runs
31all the test binaries and produces an well structured output. Test filtering and parallel test run is also available.
32
33For measuring unit test coverage lcov is utilized. The coverage of c-picker generated sources is mapped to the original sources
34files. Coverage currently only works with GCC.
35
36As a next step start with reading the :ref:`User guide` and the :ref:`Implementing tests` section of this manual. For detailed
37description of the components check the :ref:`Component user manuals` section.
38
39
40--------------
41
42*Copyright (c) 2019-2021, Arm Limited. All rights reserved.*
43
44SPDX-License-Identifier: BSD-3-Clause