feat(unittests): add a unit test framework.
This patch adds all the infrastructure needed to run unit tests for
RMM, including a new variant for platform host, called `host_test`.
To build and run the tests:
cmake -DRMM_CONFIG=host_defcfg -DHOST_VARIANT=host_test \
-DCMAKE_BUILD_TYPE=Debug -S ${RMM_SOURCE_DIR} -B ${RMM_BUILD_DIR}
cmake --build ${RMM_BUILD_DIR} -- run-unittests
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: If16686e111d91c563f8e7281d4ee7ca2864125ae
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index ab787a7..d41a145 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -162,6 +162,16 @@
cmake -DRMM_CONFIG=fvp_defcfg -S ${RMM_SOURCE_DIR} -B ${RMM_BUILD_DIR}
cmake --build ${RMM_BUILD_DIR} -- checkincludes-codebase
+14. Perform unit tests on development host:
+
+Build and run unit tests on host platform. It is recommended to do the Debug
+build of RMM.
+
+.. code-block:: bash
+
+ cmake -DRMM_CONFIG=host_defcfg -DHOST_VARIANT=host_test -DCMAKE_BUILD_TYPE=Debug -S ${RMM_SOURCE_DIR} -B ${RMM_BUILD_DIR}
+ cmake --build ${RMM_BUILD_DIR} -- run-unittests
+
.. _build_options_table:
###################
@@ -198,6 +208,7 @@
MBEDTLS_ECP_MAX_OPS ,248 - ,1000 ,"Number of max operations per ECC signing iteration"
RMM_FPU_USE_AT_REL2 ,ON | OFF ,OFF(fake_host) ON(aarch64),"Enable FPU/SIMD usage in RMM."
RMM_MAX_GRANULES , ,0 ,"Maximum number of memory granules available to the system"
+ HOST_VARIANT ,host_build | host_test ,host_build , "Variant to build for the host platform. Only available when RMM_PLATFORM=host"
diff --git a/docs/readme.rst b/docs/readme.rst
index 25a7e1d..c198f72 100644
--- a/docs/readme.rst
+++ b/docs/readme.rst
@@ -64,7 +64,7 @@
The TF-RMM project requires to be linked with certain other 3rd party projects
and they are to be cloned from their repositories into ``ext`` folder before
-building. The projects are `MbedTLS`_, `t_cose`_, and `QCBOR`_.
+building. The projects are `MbedTLS`_, `t_cose`_, `QCBOR`_ and `CppUTest`_.
The project also contains files which are imported from other projects
into the source tree and may have a different license. Such files with
@@ -119,3 +119,4 @@
.. _BSD-3-Clause License: https://tf-rmm.readthedocs.io/en/latest/about/license.html
.. _License and Copyright for Contributions: https://tf-rmm.readthedocs.io/en/latest/process/contributing.html#license-and-copyright-for-contributions
.. _Contributor's Guide: https://tf-rmm.readthedocs.io/en/latest/process/contributing.html
+.. _CppUTest: https://github.com/cpputest/cpputest.git