fix(tools/cppcheck): fail build if errors detected
If the XML generated by Cppcheck contains error tags
detected by Cppcheck and the installed Cppcheck version
matches or exceeds the minimum recommended version, then
fail the build. Otherwise, if the installed version is
less than the recommended version, generate only a warning.
NOTE: The minimum recommended Cppcheck version is
now updated to 2.14.0.
Change-Id: Ibffbc555dcc6a7a1ad33a197a180fdb52a581412
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
diff --git a/docs/getting_started/getting-started.rst b/docs/getting_started/getting-started.rst
index 4b8bfbc..910023a 100644
--- a/docs/getting_started/getting-started.rst
+++ b/docs/getting_started/getting-started.rst
@@ -55,7 +55,7 @@
"docutils",">v2.38.0","Documentation"
"gcovr",">=v4.2","Tools(Coverage analysis)"
"CBMC",">=5.84.0","Tools(CBMC analysis)"
- "Cppcheck",">=2.13.4","Tools(Cppcheck)"
+ "Cppcheck",">=2.14.0","Tools(Cppcheck)"
.. _getting_started_toolchain:
diff --git a/docs/resources/application-notes/cppcheck.rst b/docs/resources/application-notes/cppcheck.rst
index 13647b6..2ffc8c9 100644
--- a/docs/resources/application-notes/cppcheck.rst
+++ b/docs/resources/application-notes/cppcheck.rst
@@ -71,6 +71,13 @@
This will generate `cppcheck_misra.xml` in `build/tools/cppcheck` folder.
+If the above generated xml contains error tags detected by Cppcheck and
+if the installed version of Cppcheck matches or exceeds the recommended
+version mentioned in :ref:`tool_dependencies`, the build fails and prints
+the error count. However, if the installed version is less than the
+recommended version, a warning is generated and the output is not parsed
+for errors.
+
Generating the Cppcheck HTML report
===================================