주요 콘텐츠

Select from results file (-sanitizer-selection filePath)

R2026b

Select sanitizer checks guided by a Code Prover results file

Since R2026b

Description

Specify that the sanitizer selects runtime error checks guided by a Code Prover results file. When you select this option, the sanitizer instruments only those expressions where Code Prover found 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.

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 and then select Select from results file.

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

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

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

    [SanitizerOptions]
    SelectionMode = "RESULTS_FILE"

Why Use This Option

Use this option to determine which orange checks from Code Prover represent real run-time errors. Orange checks indicate possible errors that static analysis could not fully prove or disprove. By running the guided sanitizer during test execution, you can identify which of these orange checks are actually hit at run time, confirming them as real issues that require fixes. In addition, the guided sanitizer reduces instrumentation overhead by focusing only on the expressions flagged by Code Prover.

Settings

Select from results file

The sanitizer uses a Code Prover results file to determine which expressions to instrument. When you select this option, specify the path to the results file in the Code Prover results file field.

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)
Example: polyspace-code-profiler -instrument -instrum-dir instrumFolder -sanitizer -sanitizer-selection path/to/results.pscp -- compileCommand

Version History

Introduced in R2026b