主要内容

Function Call to ignore (-ignore-fcn-call)

Specify function calls to exclude from source code instrumentation

Since R2023b

Description

Specify function calls to exclude from source code instrumentation. When you specify a function as an input to this option, Polyspace® Test™ instruments the body of the function but does not instrument the calls to the function. For functions that are part of a namespace, use the fully qualified name. If you specify a function with multiple overloads, Polyspace ignores calls to all overloads of the function.

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 Code Coverage node and then enter function names for this option.

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

Why Use This Option

Exclude specific functions from your profiling calculation by using this option. For instance you can exclude third-party functions or legacy functions from your code coverage calculations using this option

Settings

No Default

Specify function calls to exclude from source code instrumentation. Add as many functions to ignore as necessary. Polyspace Test ignores calls to these functions when calculating code coverage and execution profiling.

  • Add a single function by clicking the Add empty row button and entering the qualified function name.

  • Select functions from a list by clicking the Add function from a predefined list button .

  • Add or update multiple functions by clicking the Add/edit multiple rows button and entering one qualified function name 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-fcn-call
Default: N/A
Example: polyspace-code-profiler -instrument -instrum-dir instrumFolder -ignore-fcn-call foo -- compileCommand

Version History

Introduced in R2023b