Skip to content

Commit 50d8cd4

Browse files
yashicarlescufi
authored andcommitted
doc: develop: sca: Add Parasoft C/C++test
Add documentation for Parasoft C/C++test for Static Code Analysis. Signed-off-by: Yasushi SHOJI <[email protected]>
1 parent 6a069e1 commit 50d8cd4

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

doc/develop/sca/cpptest.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _cpptest:
2+
3+
Parasoft C/C++test support
4+
##########################
5+
6+
Parasoft `C/C++test <https://www.parasoft.com/products/parasoft-c-ctest/>`__ is a software testing
7+
and static analysis tool for C and C++. It is a commercial software and you must acquire a
8+
commercial license to use it.
9+
10+
Documentation of C/C++test can be found at https://docs.parasoft.com/. Please refer to the
11+
documentation for how to use it.
12+
13+
Generating Build Data Files
14+
***************************
15+
16+
To use C/C++test, ``cpptestscan`` must be found in your :envvar:`PATH` environment variable. And
17+
:ref:`west build <west-building>` should be called with a ``-DZEPHYR_SCA_VARIANT=cpptest``
18+
parameter, e.g.
19+
20+
.. code-block:: shell
21+
22+
west build -b qemu_cortex_m3 zephyr/samples/hello_world -- -DZEPHYR_SCA_VARIANT=cpptest
23+
24+
25+
A ``.bdf`` file will be generated as :file:`build/sca/cpptest/cpptestscan.bdf`.
26+
27+
Generating a report file
28+
************************
29+
30+
Please refer to Parasoft C/C++test documentation for more details.
31+
32+
To import and generate a report file, something like the following should work.
33+
34+
.. code-block:: shell
35+
36+
cpptestcli -data out -localsettings local.conf -bdf build/sca/cpptest/cpptestscan.bdf -config "builtin://Recommended Rules" -report out/report
37+
38+
39+
You might need to set ``bdf.import.c.compiler.exec``, ``bdf.import.cpp.compiler.exec``, and
40+
``bdf.import.linker.exec`` to the toolchain :ref:`west build <west-building>` used.

doc/develop/sca/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ The following is a list of SCA tools natively supported by Zephyr build system.
6464
codechecker
6565
sparse
6666
gcc
67+
cpptest

0 commit comments

Comments
 (0)