Enable compact mode for coverage calculation
(-compact)
Reduce the amount of memory required to run test executable
Since R2023b
Description
Use this option to reduce the amount of memory required to run the test executable.
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 select this option.
Command line: Use the option
-compact. See Command-Line Information.
Why Use This Option
By default, when instrumenting your code for code coverage calculations, Polyspace® allocates an unsigned 32-bit integer counter to count the number of times a coverage outcome is achieved. When you specify this option, Polyspace allocates only a single bit to record whether a coverage outcome was achieved or not. For instance, you see the following difference in results for a decision outcome in default and compact mode:
| Outcome | Default | Compact Mode |
|---|---|---|
true | 3/3, indicating that 3 out of 3 tests resulted in true value of the decision | 1+, indicating that true value of the decision was covered in one or more of the tests |
false | 0/3, indicating that none of 3 tests resulted in false value of the decision | 0, indicating that false value of the decision was not covered in any of the tests |
The compact mode results in less information recorded but also reduces the memory required to run the instrumented test executable. If you want to make sure that all coverage outcomes are achieved but do not require further details, use this option to save on memory requirements.
Settings
OnPolyspace Test™ allocates a single bit for each callable entity in your code.
Off (default)Polyspace Test allocates a 32-bit unsigned integer for each callable entity in your code.
Tips
This option has no impact on execution profiling.
This option has no impact on the size of the instrumented test executable file.
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:-compact |
| Default: off |
Example:
polyspace-code-profiler -instrument -instrum-dir |
Version History
Introduced in R2023b