Main Content

polyspace-test -check-target-package

(System Command) Check connection to target before test execution

Since R2023b

Description

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

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

polyspace-test -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.

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 -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 -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 -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 -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 -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 -manage-target-package -unregister-from-file customPackageRemove.m

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 -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 -manage-target-package -list Board.

Version History

Introduced in R2023b