Main Content

Files to ignore (-ignore-file)

Specify files to exclude from source code instrumentation

Since R2023b

Description

When instrumenting source code for code coverage and execution profiling calculations, specify the source file that Polyspace® Test™ ignores.

Set Option

Set the option using one of these methods:

  • Polyspace Platform user interface (desktop products only): In your project configuration, on the Testing & Profiling tab, select the All Profiling node and then enter file paths for this option.

  • Command line: Use the option -ignore-file. See Command-Line Information.

Why Use This Option

Use this option to skip instrumenting certain source files, such as source files containing test cases. Scope your code coverage and execution profiling calculations to relevant files by using this option.

Settings

No Default

Enter source files to ignore when calculating code coverage metrics and the execution profile. You can add as many source files as necessary.

  • Add a single source file by clicking the Add empty row button and entering the complete path to the file.

  • Navigate to a file by clicking the Add file button .

  • Add or update multiple file paths by clicking the Add/edit multiple rows button and entering one path per line in the Add/edit multiple rows dialog box. Leading and trailing spaces are trimmed, and empty lines are ignored.

Command-Line Information

The command-line workflow for setting this option depends on your workflow.

  • If you build your source and tests using a Polyspace Platform Project — Once you set this option in the project using the Polyspace Platform user interface, you cannot override or modify this option using the polyspace-test command.

  • If you build your sources and xUnit tests using your own toolchain — Specify this option to the polyspace-code-profiler command.

Parameter:-ignore-file
Default: N/A
Example: polyspace-code-profiler -instrument -instrum-dir instrumFolder -ignore-file fileToIgnore.c -- compileCommand

Version History

Introduced in R2023b