メインコンテンツ

Organize Graphical Tests in Polyspace Platform Project Using Test Suites

Within a Polyspace® Platform project, you can organize graphical tests for your C/C++ code into named collections called test suites. Using test suites allows you to organize the graphical tests in your project into smaller subsets based on criteria such as parts of your application being tested or teams involved in the development. You can create new test suites, move tests between test suites, and run only the tests in a single suite.

Save Tests Separately from Project

In a Polyspace Platform project, you can manage your graphical tests in two different ways:

  • Use project‑specific graphical tests — When you create a new graphical test, Polyspace Test™ creates it within the Polyspace Platform project file (.psprjx). When you make changes to the test, you save the project to save those changes.

  • Save graphical tests in an external .pstestd file — To modularize your project for easier sharing and integration into version control systems, you can convert a project-specific graphical test to a test reference. A test reference is a graphical test case that you save in a .pstestd file that is linked to the project by reference. When you make changes to a test reference, you save those changes in the .pstestd file instead of the main .psprjx project file. Modularizing your project to use test references enables you to share a single-sourced test reference across similar projects by referencing the same externally saved .pstestd file. For more information, see Modularize Project by Converting Graphical Tests to Test References in Polyspace Platform User Interface. (since R2026a)

A single test suite can contain both types of graphical tests — project-specific tests that are saved in the .psprjx project file and test references that are saved in one or more .pstestd files. This flexibility allows you to combine locally owned tests and externally saved graphical tests in the same suite. The test suite container is always part of the project.

Manage Test Suites in Polyspace Platform User Interface

Create, Rename, and Delete Test Suites

By default, a newly created test is placed in a suite named pst_default_suite. To create a test in a nondefault test suite, create the test suite first. Then, create tests in the test suite or move existing tests into the test suite.

To start organizing graphical tests in a Polyspace Platform project into test suites:

  1. Create the test suite by right-clicking the Tests node of a project and selecting Add Test Suite. Enter a name for the test suite and click OK.

  2. Create a new test in the test suite by right-clicking the test suite name and selecting Add Test Case.

To rename or delete a test suite, right-click a test suite and select Rename or Delete. Select multiple test suites to delete a group of test suites.

Move Tests into Suites

To move an existing test into a test suite:

  1. Right-click the test name and select Move Test. To move a group of tests into the test suite, select multiple tests, right-click the selection, and then select Move Tests.

  2. Select the destination test suite name and click OK.

Search for Test Suites

To locate a test suite, find the suite name in the alphabetically sorted list below the Tests node of a project, or search for the suite name using the search bar on the top of the Projects pane.

Run Test Suites

To run only the tests in a single test suite:

  1. Build the Polyspace Platform project. Select Build Project on the Polyspace Platform toolstrip, or right-click the project node and select Build Project.

  2. Right-click the test suite name under the Tests node of the project and select Run Tests.

When you run all tests in a project, the test results are organized into test suites. When you select a suite, pass-fail results for the suite appear in the result details.

For information on how to run a suite of tests at the command line, see polyspace-test -run.

Manage Test Suites in Polyspace Python API

You can create and manage test suites using the Polyspace Python® API. For more information, see the TestSuites property of the polyspace.project.Project class and Author Graphical Tests Using Python API for Polyspace.

See Also

Topics