主要内容

Code Prover results file (-sanitizer-selection filePath)

R2026b

Specify path to a Code Prover results file for guided sanitization

Since R2026b

Description

Specify the path to a Code Prover results file. The results file guides the sanitizer to instrument only those expressions where Code Prover found definite or possible errors.

Set Option

Set the option using one of these methods:

  • Polyspace Platform user interface (desktop products only): In your project configuration, on the Testing and Profiling tab, select the Sanitizer node, select Select from results file, and then enter or browse to the results file path.

  • Command line: Use the option -sanitizer-selection with the path to the results file. See Command-Line Information.

  • Python® API: Set the ResultsFile property in the testing and profiling configuration. See polyspace.project.TestConfiguration.

  • TOML configuration file (.toml.pscfg) — Use the key ResultsFile in the [SanitizerOptions] table. For example:

    [SanitizerOptions]
    ResultsFile = "results.pscp"

Why Use This Option

Use this option to provide the path to a Code Prover results file when using guided mode sanitization. The sanitizer reads the results file and instruments only the expressions that Code Prover flagged as definite or possible errors (red or orange checks). If an orange check is hit during test execution, it confirms that the issue represents a real run-time error rather than a false positive. In addition, the guided sanitizer reduces instrumentation overhead by focusing only on the expressions flagged by Code Prover.

Settings

No Default

Enter the path to a Code Prover results file (.pscp) or navigate to the file using the browse button .

Dependencies

This option is available only when you select Select from results file as the sanitizer selection mode.

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: -sanitizer-selection
Value: Path to a Code Prover results file (.pscp)
Default: N/A
Example: polyspace-code-profiler -instrument -instrum-dir instrumFolder -sanitizer -sanitizer-selection path/to/results.pscp -- compileCommand

Version History

Introduced in R2026b