-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
6a069e1
commit 50d8cd4
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. _cpptest: | ||
|
||
Parasoft C/C++test support | ||
########################## | ||
|
||
Parasoft `C/C++test <https://www.parasoft.com/products/parasoft-c-ctest/>`__ is a software testing | ||
and static analysis tool for C and C++. It is a commercial software and you must acquire a | ||
commercial license to use it. | ||
|
||
Documentation of C/C++test can be found at https://docs.parasoft.com/. Please refer to the | ||
documentation for how to use it. | ||
|
||
Generating Build Data Files | ||
*************************** | ||
|
||
To use C/C++test, ``cpptestscan`` must be found in your :envvar:`PATH` environment variable. And | ||
:ref:`west build <west-building>` should be called with a ``-DZEPHYR_SCA_VARIANT=cpptest`` | ||
parameter, e.g. | ||
|
||
.. code-block:: shell | ||
west build -b qemu_cortex_m3 zephyr/samples/hello_world -- -DZEPHYR_SCA_VARIANT=cpptest | ||
A ``.bdf`` file will be generated as :file:`build/sca/cpptest/cpptestscan.bdf`. | ||
|
||
Generating a report file | ||
************************ | ||
|
||
Please refer to Parasoft C/C++test documentation for more details. | ||
|
||
To import and generate a report file, something like the following should work. | ||
|
||
.. code-block:: shell | ||
cpptestcli -data out -localsettings local.conf -bdf build/sca/cpptest/cpptestscan.bdf -config "builtin://Recommended Rules" -report out/report | ||
You might need to set ``bdf.import.c.compiler.exec``, ``bdf.import.cpp.compiler.exec``, and | ||
``bdf.import.linker.exec`` to the toolchain :ref:`west build <west-building>` used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,3 +64,4 @@ The following is a list of SCA tools natively supported by Zephyr build system. | |
codechecker | ||
sparse | ||
gcc | ||
cpptest |