メインコンテンツ

polyspace.project.TestConfiguration Class

Namespace: polyspace.project

(Python) External testing and profiling configurations that can be associated with multiple projects

Since R2026a

Description

The properties of the polyspace.project.TestConfiguration class contain the testing and profiling configuration options that are saved separately from a Polyspace® Platform project in a .pscfg external configuration file. Saving your testing and profiling configurations in .pscfg files and referencing those files from one or more projects enables you to create a modular project structure that improves sharing and version control workflows.

To work with external testing and profiling configurations, use this class, which contains the configuration, together with the polyspace.project.TestConfigurationRef class, which contains the name of the external testing and profiling configuration and the path to the .pscfg file where it is saved. The properties of this object correspond to the options related to code profiling in Polyspace Test™. See Code Profiling in Polyspace Platform User Interface.

To create and manage testing and profiling configurations that are owned by a specific project, use the polyspace.project.OwnedTestConfiguration class.

Creation

Description

externalConfig = myTestConfigurationRefObj.get() returns the polyspace.project.TestConfiguration object referenced by the polyspace.project.TestConfigurationRef object myTestConfigurationRefObj. For more information on managing external configurations referenced by the project, see polyspace.project.TestConfigurationRef.

Properties

expand all

Relative or absolute path to the .pscfg configuration file where the external testing and profiling configuration is saved. This file is referenced by the project and managed using the polyspace.project.TestConfigurationRef class. Relative paths are considered relative to the location of the .psprjx project file. This property is read-only.

Example: "configs/myTestConfig.pscfg"

Optional description of the test configuration. Use this property to provide information about the test configuration.

Example: "Test configuration for MCDC"

Enable this property to reduce the amount of memory Polyspace uses to run the test executable. Set this property to True if you have a large test executable that requires more memory than available.

See also Enable compact mode for coverage calculation (-compact).

Example: testConf.CoverageOptions.Compact=True

Level of code coverage metric calculation. The number of code coverage metrics calculated increases in this order: STATEMENT, DECISION, CONDITION_DECISION, MCDC.

For more information on which metrics are calculated, see Coverage metrics (-cov-metric-level).

Example: testConf.CoverageOptions.Level=testConf.CoverageOptions.Level.MCDC

Enable relational boundary coverage calculations. Polyspace Test determines the number of boundaries for all relational operations in your code and then calculate the percentage of tested boundaries out the total number of boundaries. For example, the relational operation between integers var1 > var2 has three boundaries and can be tested with these values:

  • var1 == var2

  • var1 == var2 + 1

  • var1 == var2 - 1

See also Enable relational boundary coverage (-cov-relbound) and Relational Boundary Coverage.

Example: testConf.CoverageOptions.RelationalBoundary=True

Value of absolute tolerance of floating-point relational operation. Use this value to tune the tolerance when calculating the relational boundary coverage for a floating-point or fixed-point relational operation.

See also Absolute tolerance (-cov-relbound-abs-tol).

Example: testConf.CoverageOptions.RelationalBoundaryAbsTol=1e-6

Value of relative tolerance of floating-point relational operation. Use this value to tune the tolerance when calculating the relational boundary coverage for a floating-point or fixed-point relational operation.

See also Relative tolerance (-cov-relbound-rel-tol).

Example: testConf.CoverageOptions.RelationalBoundaryRelTol=0.001

Specify additional options that cannot be specified in the existing options.

To modify this property, use these methods:

  • append(option) — Add an option to this property.

  • pop(optionIdx) — Remove the option with index optionIdx. If you do not specify an index, the last option in the list is removed.

  • clear() — Remove all options associated with this property.

See also Additional options.

Example: testConf.ProfilingOptions.ExtraOptions.append("-fail-if-error")

Example: testConf.ProfilingOptions.ExtraOptions.pop(0)

Specify path of source files that Polyspace Test ignores when instrumenting your source code for code coverage and execution profiling calculations.

To modify this property, use these methods:

  • append(filePath) — Add the path of a file to ignore.

  • pop(filePathIdx) — Remove the file path with index filePathIdx. If you do not specify an index, the last file path in the list is removed.

  • clear() — Remove all file paths associated with this property.

See also Files to ignore (-ignore-file).

Example: testConf.ProfilingOptions.FileToIgnore.append("/path/to/file.c")

Example: testConf.ProfilingOptions.FileToIgnore.pop(0)

Specify path of folders that Polyspace Test ignores when instrumenting your source code for code coverage and execution profiling calculations.

To modify this property, use these methods:

  • append(folderPath) — Add the path of a folder to ignore.

  • pop(folderPathIdx) — Remove the folder path with index folderPathIdx. If you do not specify an index, the last folder path in the list is removed.

  • clear() — Remove all folder paths associated with this property.

See also Folders to ignore (-ignore-dir).

Example: testConf.ProfilingOptions.FoldersToIgnore.append("/path/to/folder")

Example: testConf.ProfilingOptions.FoldersToIgnore.pop(0)

Specify path of folders that Polyspace Test parses for source files to instrument. Use this option to limit the code profiling to only the source files in the specified folders.

To modify this property, use these methods:

  • append(folderPath) — Add the path of a folder to profile.

  • pop(folderPathIdx) — Remove the folder path with index folderPathIdx. If you do not specify an index, the last folder path in the list is removed.

  • clear() — Remove all folder paths associated with this property.

See also Folders to profile (-limit-instrumentation-to).

Example: testConf.ProfilingOptions.FoldersToProfile.append("/path/to/folder")

Example: testConf.ProfilingOptions.FoldersToProfile.pop(0)

Specify function calls to exclude from source code instrumentation. For each function call that you specify, Polyspace instruments the body of the function but not calls to that function. Use the fully qualified name of functions that are part of a namespace, for example foo::bar::calculate().

Use this option to exclude functions such as third-party or legacy functions from your profiling calculations.

See also Function Call to ignore (-ignore-fcn-call).

Example: testConf.ProfilingOptions.FunCallToIgnore.add("foo")

Example: testConf.ProfilingOptions.FunCallToIgnore.remove("foo")

Specify functions to exclude from source code instrumentation. Use the fully qualified name of functions that are part of a namespace, for example foo::bar::calculate().

Use this option to skip profiling specific functions in your code base such as third-party API or legacy functions.

See also Functions to ignore (-ignore-fcn).

Example: testConf.ProfilingOptions.FunToIgnore.add("main")

Example: testConf.ProfilingOptions.FunToIgnore.remove("main")

Methods

expand all

Version History

Introduced in R2026a