Main Content

polyspace-test -convert

(System Command) Convert test or code profiling results to standard Polyspace Test format

Since R2023b

Description

The system command polyspace-test -convert converts test and code profiling results from a machine-readable or binary format to a format that can be reviewed in the Polyspace® Platform user interface.

polyspace-test -convert -results-dir <resultsFolder> <testResultFiles> [testOptions] converts test results from a machine-readable (.mrf) or XML format to the standard Polyspace Test™ result (.pstestr) format. You can then review these results in the Polyspace Platform user interface or upload the results to the Polyspace Access™ web server.

polyspace-test -convert -results-dir <resultsFolder> -instrum-dir <instrumFolder> <profilingResultFiles> [profilingOptions] converts code profiling results from a binary (.bin) format to the standard Polyspace Test code profiling result (.psprof) format. You can then review these results in the Polyspace Platform user interface or upload the results to the Polyspace Access web server.

Input Arguments

collapse all

Path to folder where the converted result file is stored.

One or more space-separated paths to test result files in machine-readable (.mrf) or XML format. If you attempt to convert XML test results, make sure that the XML format is either the Polyspace Test XML format or the GoogleTest format.

One or more space-separated paths to code profiling result files in binary (.bin) format. Even if your files do not have the .bin extension, the polyspace-test -convert command attempts to convert them anyway.

Options for converting test results.

OptionDescription
-compilation-working-dir <folderPath>

Path to the folder from which the source and test code was compiled. The polyspace-test command uses this information to determine the location of the source files when converting test results. For more information on this workflow, see Define Test Results Format.

Using this option allows you to navigate from a test result in the user interface to the corresponding location in the source code. If you do not specify this option, the command generates a valid .pstestr file that you can open in the user interface. But you cannot navigate from the test results to the source code.

-add-environment-info <filePath>

Path to JSON file specifying environment information to be added to the report. Use this option if you want to save environment information in your profiling result reports.

The JSON file has the following structure:

{
    "BuildConfiguration": "<nameOfConfiguration>",
    "ConfigurationDescription": "<descriptionOfConfiguration>",
    "Toolchain": "<nameOfToolchain>",
    "Board": "<nameOfBoard>"
}
You can set these values as desired to reflect your profiling configuration.

Note that if you generate a report using a Polyspace Platform project, the same values are automatically populated from your project configuration and you do not require to specify an additional file for the environment information. For more information on the values expected for the JSON keys, see Structure of HTML Reports Generated from C/C++ Test Results.

Example: -add-environment-info env_info.json

Options for converting code profiling results.

OptionDescription
-do-not-remove-duplicated

Whether duplicate results must be retained. This option is relevant when you are converting multiple result files and there is an overlap of source files between the results:

  • If you do not use this option, for each source file, the profiling results are shown from the last converted result that contains the source.

  • If you use this option, for each source file, the profiling results are shown from all converted results that contain the source.

-add-environment-info <filePath>

Path to JSON file specifying environment information to be added to the report. Use this option if you want to save environment information in your profiling result reports.

The JSON file has the following structure:

{
    "BuildConfiguration": "<nameOfConfiguration>",
    "ConfigurationDescription": "<descriptionOfConfiguration>",
    "Toolchain": "<nameOfToolchain>",
    "Board": "<nameOfBoard>"
}
You can set these values as desired to reflect your profiling configuration.

Note that if you generate a report using a Polyspace Platform project, the same values are automatically populated from your project configuration and you do not require to specify an additional file for the environment information. For more information on the values expected for the JSON keys, see Structure of HTML Reports Generated from C/C++ Test Results.

Example: -add-environment-info env_info.json

Path to folder containing code instrumentation files. This folder is the same as the argument of the option -instrum-dir when you instrument source code for profiling using the command polyspace-code-profiler -instrum-dir. For more information, see polyspace-code-profiler.

Version History

Introduced in R2023b