Select by category (-sanitizer-selection errorType)
R2026berrorTypeSelect 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-selectionwith a comma-separated list of categories. See Command-Line Information.Python® API: Set the
SelectionModeproperty in the testing and profiling configuration. Seepolyspace.project.TestConfiguration.TOML configuration file (
.toml.pscfg) — Use the keySelectionModein the[SanitizerOptions]table with a value ofCATEGORYorRESULTS_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-testcommand.If you build your sources and xUnit tests using your own toolchain — Specify this option to the
polyspace-code-profilercommand.
Parameter: -sanitizer-selection |
Value: Comma-separated list of categories: numeric, memory, memleak |
Example:
polyspace-code-profiler -instrument -instrum-dir |
Version History
Introduced in R2026b