cpptestcli -data "c:\MyWorkspace" -resource "ProjectToTest" -config builtin://ShouldHaveRules -publishteamserver -localsettings acme_policy.settings
The reports will be sent after each batch run, and trend reports will be populated with data. The reports will also be available for viewing via Parasoft> Explore> Team Server Reports.
The general procedure for testing from the command line is as follows:
Specifies that you want to run the Test Configuration available at
This parameter is required except when importing projects.
%CONFIG_URL%is interpreted as a URL, the name of a Test Configuration, or the path to a local file. Examples:
- By filename:
- By URL:
- Built-in configurations:
-config "builtin://Demo Configuration"
-config "Demo Configuration"
- User-defined configurations:
-config "user://My First Configuration"
- Team configurations:
-config "team://Team Configuration"
- By filename:
-help- Displays help information. Does not run testing.
Anchor localsettings %LOCALSETTINGS_FILE% localsettings %LOCALSETTINGS_FILE%
-machineid- Prints your machine ID.
%LOCALSETTINGS_FILE% -Reads the options file
%LOCALSETTINGS_FILE%for global preferences. These settings specify details such as Parasoft DTP settings, email settings, and Team Server settings.
The options file is a properties file. These files can control reporting preferences (who should reports be sent to, how should those reports be labelled, what mail server and domain should be used, etc.) Team Server settings, Parasoft DTP settings, email settings, and more. For details on creating options files; see Local Settings (Options) Files.
-nobuild- Prevents C++test from rebuilding the project before testing it. Use this option if the project is already built before the test run.
-fail- Fails the build by returning a non-zero exit code if any violations are reported.
-publish- Publishes the report to DTP. You can enable sending reports to DTP in the GUI or in the command line mode; see
-publishteamserver- Publishes the report to the Team Server. The Team Server location can be specified in the GUI or in the options file (described in the
%REPORT_FILE% -Generates an XML report to the given file
%REPORT_FILE%and adds an HTML (or PDF or custom format—if specified using the report.format option) report with the same name (and a different extension) in the same directory.
All of the following commands will produce an HTML report
filename.htmland an XML report
If the specified path ends with an ".html"/".htm"/".xml" extension, it will be treated as a path to the report file to generate. Otherwise, it will be treated as a path to a directory where reports should be generated.
If the file name is explicitly specified in the command and a file with this name already exists in the specified location, the previous report will be overwritten. If your command doesn’t explicitly specify a file name, the existing report file will not be overwritten—the new file will be named repXXXX.html, where XXXX is a random number.
-reportoption is not specified, reports will be generated with the default names "report.xml/html" in the current directory.
_NAME:port% -Pulls settings stored on the DTP server (recommended for ease of maintenance — especially if you do not already have a locallocally stored settings file).
-encodepass <plainpassword> -Generates an encoded version of a given password. Prints the message 'Encrypted password: <encpass>' and terminates the cli application.
If your nightly process will 1) login to Team Server and b) send emails, you can use this option to encrypt the required passwords.
-showdetails- Prints detailed test progress information.
-buildscript %SCRIPT_FILE%- Executes the specified build script prior to any testing. See Using the cli with an Eclipse-Based Builder.