1.. _cpptest: 2 3Parasoft C/C++test support 4########################## 5 6Parasoft `C/C++test <https://www.parasoft.com/products/parasoft-c-ctest/>`__ is a software testing 7and static analysis tool for C and C++. It is a commercial software and you must acquire a 8commercial license to use it. 9 10Documentation of C/C++test can be found at https://docs.parasoft.com/. Please refer to the 11documentation for how to use it. 12 13Generating Build Data Files 14*************************** 15 16To 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`` 18parameter, 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 25A ``.bdf`` file will be generated as :file:`build/sca/cpptest/cpptestscan.bdf`. 26 27Generating a report file 28************************ 29 30Please refer to Parasoft C/C++test documentation for more details. 31 32To 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 39You 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. 41