Initial version of unit testing documentation
This commit includes the 'User guide' and 'Implementing tests' sections
for helping people building, running and writing unit tests. A more
detailed version of documentation is available under the 'Component
user manuals section'.
Change-Id: I67e93ac805d1f4e7727964f3d95a70436ae34733
Signed-off-by: Imre Kis <imre.kis@arm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86c55b5..71bb31c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,84 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+#[===[.rst:
+Processing flow
+---------------
+
+The following steps show how the CMake based build system works. The first
+couple steps are responsible for detecting and checking the environment. The
+following steps are the fetching and building phase of CppUTest. Finally it
+collects the test cases.
+
+1. Checking if :cmake:variable:`TF_A_PATH` is specified
+
+2. Checking git
+
+3. Fetching CppUTest
+
+4. Building CppUTest
+
+5. Configuring coverage targets if they are enabled
+
+6. Collecting unit test suites
+
+Note that the included modules can also execute further checks and commands on
+init.
+
+
+Variables
+---------
+
+The following cache entries can be set with the ``-D`` command line option of
+CMake when the configuration phase is first run. This allows applying
+environment specific configuration to the build. The current values of these
+variables can be checked by opening ``CMakeCache.txt`` in the build directory or
+by using ``cmake-gui``.
+
+.. cmake:variable:: TF_A_PATH
+
+Path of the Trusted Firmware-A source directory. **This needs to be specified
+by the developer** to point to a suitable working copy of TF-A.
+
+.. cmake:variable:: TF_A_UNIT_TESTS_PATH
+
+Root directory of unit test repository. It can be used to reference source
+files from the unit test repository relative to its root directory.
+
+.. cmake:variable:: CPPUTEST_URL
+
+URL of the CppUTest git repository. By default it points to the official Github
+repository of CppUTest. It can be used to specify a different CppUTest mirror.
+
+.. cmake:variable:: CPPUTEST_REFSPEC
+
+CppUTest git refspec. The default value selects the latest release.
+
+.. cmake:variable:: CPPUTEST_INSTALL_PATH
+
+Temporary directory used during CppUTest build
+
+.. cmake:variable:: CPPUTEST_PACKAGE_PATH
+
+Path of the CppUTest CMake package directory
+
+.. cmake:variable:: CPICKER_CACHE_PATH
+
+Directory of c-picker generated files. Subdirectories are added according to
+the path of the original source file's path.
+
+.. cmake:variable:: CLANG_LIBRARY_PATH
+
+c-picker uses libclang to parse the source files. If defined this variable
+specifies the path of the library.
+
+.. cmake:variable:: COVERAGE
+
+Adds compiler flags for coverage measurement and enables ``coverage`` and
+``coverage_report`` targets.
+
+#]===]
+
cmake_minimum_required(VERSION 3.11...3.15) # TODO: test with ubuntu
project(tf-a-unit-tests)