主要内容

polyspace-test-server -check-target-package

R2026b

(System Command) Check connection to target before test execution

Since R2026b

Description

The system command polyspace-test-server -check-target-package runs checks on a previously registered target board and toolchain to validate the connection to the board.

polyspace-test-server -check-target-package -list-checks lists the possible checks that can be run to validate the connection to a target board.

example

polyspace-test-server -check-target-package -check <checkType> -toolchain <toolchainName> -board <boardName> runs the check <checkType> on the board <boardName> and toolchain <toolchainName> to validate the connection to a target board.

example

polyspace-test-server -check-target-package -check <checkType> -project <projectName> [-build-config <configName>] runs the check <checkType> on the board and toolchain specified in the active build configuration of the project <projectName>. You can also check the board and toolchain in another build configuration in the project by specifying the configuration name.

Examples

collapse all

This example shows how to register a target for use with Polyspace® Test™.

Follow these steps using files in the folder <polyspaceroot>\polyspace\examples\doc_pstest\execute_on_target. Here, <polyspaceroot> is the Polyspace installation folder.

  1. Register a target package using the custom target registration file customPackage.m.

    polyspace-test-server -manage-target-package -register-from-file customPackage.m
    This registration file registers a board myTarget along with a toolchain myToolchain. For more information on the basics of authoring a custom target registration file, see Create Target Registration Packages for C/C++ Test Execution on Targets.

  2. List the target boards registered for use with Polyspace Test.

    polyspace-test-server -manage-target-package -list Board
    The board myTarget appears in the list of registered boards.

  3. List the toolchains registered for use with Polyspace Test.

    polyspace-test-server -manage-target-package -list Toolchain
    The toolchain myToolchain appears in the list of registered toolchains.

  4. List the checks that can be performed to test the connection to a target board.

    polyspace-test-server -check-target-package -list-checks
    The check BoardUsingPSTUnit appears in the list of available checks. This check builds some simple sources and tests using the toolchain in the target and runs the resulting application on the target board.

  5. Run the check BoardUsingPSTUnit to test the connection to the target.

    polyspace-test-server -check-target-package -check BoardUsingPSTUnit -toolchain myToolchain -board myTarget
    If all checks complete without errors, you see the status:
    BoardUsingPSTUnit Status: OK
    Otherwise, you see an appropriate error message.

  6. Unregister the target using the custom target unregistration file.

    polyspace-test-server -manage-target-package -unregister-from-file customPackageRemove.m

This example shows how to configure and validate a template toolchain from the command line.

Template toolchains are predefined toolchains that correspond to compilers known to Polyspace Test. Before you can build or check a template toolchain, you must configure it by setting the required environment variables. For more information on template toolchain configuration, see Types of Template Toolchains.

This example uses the greenhills - i386 template toolchain as an illustration. You can apply the same approach to any other template toolchain by using the corresponding environment variable and toolchain name.

  1. Set the environment variable required by the template toolchain. For a folder-based cross-compiler template toolchain, set the folder path to the compiler installation directory. For instance, on a Windows command prompt, you can set the variable as follows:

    set "PS_GREENHILLS_I386_FOLDER=C:\compilers\greenhills\comp_202214"
    For GCC-based or Clang-based template toolchains, you set path variables such as PS_GNU_C_COMPILER, PS_GNU_CXX_COMPILER, and PS_GNU_LINKER. For Visual-based toolchains, you set PS_VISUAL_SETUP_COMMAND.

    Alternatively, instead of setting environment variables, you can configure the toolchain folder path directly in the project build configuration using the Configure toolchain options dialog box. In that case, you can skip this step and simply run the check command with the -project option.

  2. Run the Toolchain check on the template toolchain. Because the greenhills - i386 toolchain is a cross-compiler, set the board to None.

    polyspace-test-server -check-target-package -check Toolchain -toolchain "greenhills - i386" -board None
    If the toolchain is correctly configured, you see a status like:
    - C Compiler: Passed
    - C Linker: Passed
    - C++ Compiler: Passed
    - C++ linker: Passed
    - Archiver: Passed
    => Toolchain Status: Passed

    If the toolchain is not configured, you see an error like:

    The compilation toolchain 'greenhills - i386' is not fully configured. The following required setting is missing: 'Folder'

Input Arguments

collapse all

Validation tests to run on the target package, specified as one of these values:

  • Toolchain: Build a simple source file using the toolchain specified in the target and check if the build leads to errors.

  • Board: Run a simple addition application on the board specified in the target, get the execution results, and check if the results of the addition are as expected.

  • BoardUsingPSTUnit: Build a simple source and xUnit test file using the toolchain and board information specified in the target, run the resulting application on the target, and check if the build leads to errors.

  • All: Run all previous checks.

Name of the compilation toolchain for testing. To see the names of all toolchains registered with Polyspace Test, use the command polyspace-test-server -manage-target-package -list Toolchain.

Name of the hardware board used for testing. To see the names of all boards registered with Polyspace Test, use the command polyspace-test-server -manage-target-package -list Board.

Name of a Polyspace Platform project. The check runs on the board and toolchain specified in the active build configuration of the project.

Example: greenhillsProject.psprjx

Name of a Polyspace Platform project build configuration. The check runs on the board and toolchain specified in the project build configuration with this name.

Version History

Introduced in R2026b