メインコンテンツ

polyspace.project.ExecutionOptions Class

R2026b

Namespace: polyspace.project

(Python) Options for test execution in a project

Since R2026b

Description

The polyspace.project.ExecutionOptions class contains options that control how tests are executed in a Polyspace® Platform project. Use this class to configure execution options for external tests such as GoogleTest tests.

To access the execution options of a project, use the ExecutionOptions property of the polyspace.project.Project class.

Creation

Description

execOpts = proj.ExecutionOptions returns the polyspace.project.ExecutionOptions object for the project proj, where proj is a polyspace.project.Project object.

example

Properties

expand all

Options that control how external tests (such as GoogleTest tests) are executed in the project, specified as an ExternalTestsOptions object. This property is read-only. Use the properties of the returned object to configure external test execution options.

The ExternalTestsOptions object has these properties:

PropertyTypeDescription
Frameworkpolyspace.project.ExternalTestFramework

External test framework used by the project. Possible values are polyspace.project.ExternalTestFramework.GOOGLETEST and polyspace.project.ExternalTestFramework.GENERIC. Read-write.

AdditionalOptionsstr or None

Additional command-line options to pass to the test executable. For instance, for GoogleTest, you can specify options such as --gtest_filter=MySuite.*. Corresponds to the Additional options configuration option. Read-write.

CommandLinestr or None

Command line to use for executing external tests. Corresponds to the Command line configuration option. Read-write.

TestOutputOptionsstr or None

Options that control how test output is generated. Corresponds to the Test output options configuration option. Read-write.

TestOutputFilestr or None

Path to the output file for test results. Corresponds to the Output file configuration option. Read-write.

OutputConversionExternalTestOutputConversion

Method used to convert external test output to the Polyspace Test™ format. Possible values are ExternalTestOutputConversion.XML_PSTUNIT_FORMAT, ExternalTestOutputConversion.XSLT_CONVERSION, ExternalTestOutputConversion.XML_COMMAND_LINE_CONVERSION, and ExternalTestOutputConversion.COMMAND_LINE_CONVERSION. Read-write.

XSLTFilestr or None

Path to the XSLT file used to convert external test output. Applicable when OutputConversion is set to ExternalTestOutputConversion.XSLT_CONVERSION. Read-write.

Examples

collapse all

Configure a project to run GoogleTest tests with a filter option.

Open an existing project and access the execution options.

import polyspace

proj = polyspace.project.Project("myProject.psprjx")
execOpts = proj.ExecutionOptions
extTestOpts = execOpts.ExternalTests

Set the framework to GoogleTest and specify a filter option.

extTestOpts.Framework = polyspace.project.ExternalTestFramework.GOOGLETEST
extTestOpts.AdditionalOptions = "--gtest_filter=MySuite.*"

Save the project to persist the changes.

proj.save()
proj.close()

Version History

Introduced in R2026b