build(coverage): break dependency between 'run-coverage' and 'run-unittests' rules
If 'run-coverage' is run without a previous run or rmm.elf (and even
withouth build RMM at all), the rule will generate an empty coverage
report.
This patch also updates the build options documentation.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: Ibef3b4d265e13ea92e11bad9b05642703c855fea
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index 5e0adfe..6667fe8 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -164,23 +164,54 @@
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.
+Build and run unit tests on host platform. It is recommended to enable 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
-Run coverage analysis on unit tests.
+Run unittests for a specific test group(s) (e.g. unittests whose group starts with 'xlat')
+
+.. 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} -- build -j
+ ${RMM_BUILD_DIR}/Debug/rmm.elf -gxlat -v -r${NUMBER_OF_TEST_ITERATIONS}
+
+15. Generate Coverage Report.
+
+It is possible to generate a coverage report for a last execution of the host
+platform (whichever the variant) by using the `run-coverage` build target.
+
+For example, to generate coverate report on the whole set of unittests:
.. code-block:: bash
cmake -DRMM_CONFIG=host_defcfg -DHOST_VARIANT=host_test -DRMM_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -S ${RMM_SOURCE_DIR} -B ${RMM_BUILD_DIR}
+ cmake --build ${RMM_BUILD_DIR} -- run-unittests
+ cmake --build ${RMM_BUILD_DIR} -- run-coverage
+
+Run coverage analysis on a specific set of unittests (e.g. unittests whose group starts with 'xlat')
+
+.. code-block:: bash
+
+ cmake -DRMM_CONFIG=host_defcfg -DHOST_VARIANT=host_test -DRMM_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -S ${RMM_SOURCE_DIR} -B ${RMM_BUILD_DIR}
+ cmake --build ${RMM_BUILD_DIR} -- build -j
+ ${RMM_BUILD_DIR}/Debug/rmm.elf -gxlat
+ cmake --build ${RMM_BUILD_DIR} -- run-coverage
+
+Run coverage analysis on the `host_build` variant of host platform:
+
+.. code-block:: bash
+
+ cmake -DRMM_CONFIG=host_defcfg -DHOST_VARIANT=host_build -DRMM_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -S ${RMM_SOURCE_DIR} -B ${RMM_BUILD_DIR}
+ ${RMM_BUILD_DIR}/Debug/rmm.elf
cmake --build ${RMM_BUILD_DIR} -- run-coverage
The above commands will automatically generate the HTML coverage report in folder
-`build/Debug/coverage` within build directory. The HTML generation can be
+`build/Debug/coverage` within the build directory. The HTML generation can be
disabled by setting `RMM_HTML_COV_REPORT=OFF`.
.. _build_options_table: