Imre Kis | a21712e | 2019-10-08 12:56:59 +0200 | [diff] [blame^] | 1 | Welcome 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 | |
| 15 | This repository contains the unit testing framework. |
| 16 | |
| 17 | These tests are meant to run on host machine and used to cover platform independent code on the unit test level. In this case a |
| 18 | unit is considered to be a C function or couple related functions. Each unit test suite compiles into a binary which can be run |
| 19 | and debugged as any ordinary executable. |
| 20 | |
| 21 | The system uses CppUTest as unit testing framework. The tests are written in C++ in order to be able to use CppUTests' all |
| 22 | useful features like the automatic collection of test cases and the CppUMock mocking system. |
| 23 | |
| 24 | Separating dependencies apart from the code under test is a crutial step in unit testing systems. In many cases this can be |
| 25 | easily done by linking mocked functions to the tested code but sometimes it's difficult like when the code under test and its |
| 26 | dependencies are in the same compilation unit. For separating the code under test from its dependencies a tool called c-picker |
| 27 | can be used. It can pick pieces of code (functions, variables, etc.) based on descriptor files. |
| 28 | |
| 29 | The build system is based on CMake. The repository contains CMake modules for defining unit test suites. It also invokes |
| 30 | c-picker if a descriptor file is listed among the test sources. CMake has a built in test driver system called ctest. It runs |
| 31 | all the test binaries and produces an well structured output. Test filtering and parallel test run is also available. |
| 32 | |
| 33 | For measuring unit test coverage lcov is utilized. The coverage of c-picker generated sources is mapped to the original sources |
| 34 | files. Coverage currently only works with GCC. |
| 35 | |
| 36 | As a next step start with reading the :ref:`User guide` and the :ref:`Implementing tests` section of this manual. For detailed |
| 37 | description 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 | |
| 44 | SPDX-License-Identifier: BSD-3-Clause |