メインコンテンツ

Select by category (-sanitizer-selection errorType)

R2026b

Select sanitizer checks by error category

Since R2026b

Description

Specify that the sanitizer selects runtime error checks by error category. When you select this option, you can choose one or more error categories to detect at runtime. Available categories include numeric errors, memory errors, and memory leaks.

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 by category.

  • Command line: Use the option -sanitizer-selection with a comma-separated list of categories. 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 with a value of CATEGORY or RESULTS_FILE. For example:

    [SanitizerOptions]
    SelectionMode = "CATEGORY"

Why Use This Option

Use this option when you want to select specific categories of runtime errors to detect. For instance, you might want to detect only numeric errors and memory errors, but not memory leaks. Selecting by category gives you fine-grained control over which sanitizer checks are enabled.

Settings

Select by category (default)

The sanitizer detects runtime errors based on the error categories that you select. You can enable or disable each category individually:

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: Comma-separated list of categories: numeric, memory, memleak
Example: polyspace-code-profiler -instrument -instrum-dir instrumFolder -sanitizer -sanitizer-selection numeric,memory -- compileCommand

Version History

Introduced in R2026b