Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CPPTDESKDEV and version 2021.1

...

We recommend that you keep consistency with the metrics enabled for the cpptestcc tool in the compilation command line.

Anchor
cmake_coverage_extension
cmake_coverage_extension
Collecting Application Coverage for CMake Projects

C/C++test ships with an extension for CMake that allows you to integrate C/C++test's code coverage analysis directly into your CMake project. The extension automatically modifies your compiler/linker command lines to use the cpptestcc coverage tool when building your project. As a result, after you run the instrumented application or execute functional or unit tests, a C/C++test coverage log file (.clog) is created. The coverage log file can then be used to generate a complete code coverage report.

...

  1. Copy the cpptest.c file from <INSTALL_DIR>/bin/engine/coverage/runtime/src/cpptest.c to your preferred location.

  2. Introduce any customizations as described in Customizing the Runtime Library.
  3. Set up a build system of your preference (e.g., IAR Embedded Workbench project or any other type of source code builder).
  4. Modify the compilation flags to contain the compiler include a flag (typically -I) with the following value:-I <INSTALL_DIR>/bin/engine/coverage/runtime/include-I <INSTALL_DIR>/engine/coverage/runtime/include

  5. Add any required configuration defines (typically -D), for example:
    -DCPPTEST_FILE_COMMUNICATION -DCPPTEST_NO_THREADS
  6. Invoke the command to run your builder (for example, select build command in the IDE).
  7. Locate the resulting object file and use it to link with your instrumented application.

...