...
cpptestcli -data "c:\MyWorkspace" -resource "ProjectToTest" -config builtin://ShouldHaveRules -publish -settings acme_policy.settings
The reports will be sent to Parasoft DTP after each batch run.
cli Usage
The general procedure for testing from the command line is as follows:
...
Options for Importing and Creating Projects
| Option | Purpose | Notes |
|---|
-import %ECLIPSE_PROJECT%
| Imports the specified Eclipse project(s) into the Eclipse workspace. | If %ECLIPSE_PROJECT% is a .project file, the selected project will be imported If it is a directory, all Eclipse projects found in the selected directory and subdirectories will be imported. Examples: -import \".project\"
-import \"c:\\DevelRootDir\"
The -config option is not necessary while using -import. If the -config option is specified, then the workspace with the imported project(s) will be tested; otherwise, the project will be imported, but no testing will be performed. |
-bdf <cpptestscan.bdf>
| Creates C/C++test projects from build definition files (.bdf). To prepare a BDF, perform a build of the project with the cpptestscan utility as the prefix for the compiler / linker executable. This option also supports JSON formatted files generated by the CMake build system when running static analysis. Using this option to specify a JSON file for unit test execution is not currently supported. | Example: -bdf "cpptestscan.bdf" See Creating a Project Using an Existing Build System for details. Options can be specified in the options file. See Settings (Options) Files for details. The -config option is not necessary while using -import. If the -config option is specified, then the workspace with the imported project(s) will be tested; otherwise, the project will be imported, but no testing will be performed. |
-gpj <.prj_root_file>
| Creates C/C++test projects from Green Hills .gpj projects. | Green Hills .gpj project import options can be specified in the options file. See Settings (Options) Files for details. The -config option is not necessary while using -import. If the -config option is specified, then the workspace with the imported project(s) will be tested; otherwise, the project will be imported, but no testing will be performed. |
-hew %HEW_PROJECT% | Imports Highperformance Embedded Workshop projects. The following can be specified as %HEW_PROJECT%: .hwp project file: The selected project will be imported. .hws workspace file: All projects from the workspace will be imported. directory: All .hwp projects found in the selected directory and subdirectories will be imported | The -config option is not necessary while using -import. If the -config option is specified, then the workspace with the imported project(s) will be tested; otherwise, the project will be imported, but no testing will be performed. Examples: -hew "MyProject.hwp" -hew "MyWorkspace.hws" -hew "c:\DevelRootDir" |
-uv %KEILUV_PROJECT%
| Imports Keil uVision projects. If %KEILUV_PROJECT% is: .uvproj project file - the selected project will be imported directory - all .uvproj projects found in selected directory and subdirectories | The -config option is not necessary while using -import. If the -config option is specified, then the workspace with the imported project(s) will be tested; otherwise, the project will be imported, but no testing will be performed. Examples: -uv "MyProject.uvproj" -uv "c:\DevelRootDir" |
Options for Testing Projects Available in the C/C++test for Eclipse Workbench
| Option | Purpose | Notes |
|---|
| Specifies the location of the Eclipse workspace directory to use. | Defaults to the current user’s dependent directory. |
-resource %RESOURCE%
| Specifies the path to the workspace resource %RESOURCE% to test. | Use multiple times to specify multiple resources. Use quotes when the resource path contains spaces or other non-alphanumeric characters. If %RESOURCE% is a .properties file, the value corresponding to com.parasoft.xtest.checkers.resources will be interpreted as a colon(:)-separated list of resources. Only one properties file can be specified in this way. If %RESOURCE% is a .lst file, each line will be treated as a resource. If no resources are specified on the command line, the complete workspace will be tested. Team Project Set File (PSF) files are supported for SVN and other source control systems (depending on the Eclipse plugin capabilities installed). Paths (even absolute ones) are relative to the workspace specified by the -data parameter. Examples: -resource "Acme Project"
-resource "/MyProject/src/com/acme/MyClassTest.java"
-resource "/MyProject/src/com/acme"
-resource testedprojects.properties
|
| Note |
|---|
|
- To see a list of valid command line options, enter for
cpptestcli -help. cpptestcli automatically emails designated group managers and architects a report that lists all team/project errors and identifies which developer is responsible for each error. If no errors are reported, reports will be sent unless the options file contains the report.mail.on.error.only=true option.- If the appropriate prerequisites are met,
cpptestcli automatically emails each developer a report that contains only the errors/results related to his or her work. If no errors are reported for a particular developer, a report will not be emailed to that developer.
|
...