Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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.

 

cli Usage

The general procedure for testing from the command line is as follows:

...

Info
titleExcluding Specific Project Resources from Analysis/Testing

If you want to exclude some files from analysis/testing (for instance, to prevent static analysis of automatically-generated files), you can indicate which project resources should not be tested as described in Excluding Project Resources from Testing. Perform this configuration in the GUI, then the settings will be applied for all tests on this project—from the GUI or from the command line.

 

Using -data to Specify Your Eclipse Workspace

...

If you are in the same directory as the workspace that you want to test, you can call cpptestcli without the-data option. For example, this Windows command tests the C++test Example project by applying the My Configuration Test Configuration, generates a report of results, and saves that report in the c:\reports\Report1 directory:

cpptestcli -resource "C++test Example" -config user://"My Configuration" -report c:\reports\Report1

 

cli Options

Anchor
cli_options
cli_options

...

  • -config %CONFIG_URL% - Specifies that you want to run the Test Configuration available at %CONFIG_URL%.
     
    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:
      -config "mylocalconfig.properties"
    • By URL:
      -config "http://intranet.acme.com/cpptest/team_config.properties"
    • Built-in configurations:
      -config "builtin://Demo Configuration"
      -config "Demo Configuration"
    • User-defined configurations:
      -config "user://My First Configuration"
    • Team configurations:
      -config "team://Team Configuration"
      -config "team://teamconfig.properties"
  • -helpDisplays help information. Does not run testing.
    Anchor
    localsettings %LOCALSETTINGS_FILE%
    localsettings %LOCALSETTINGS_FILE%
  • -localsettings %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.
  • -nobuildPrevents C++test from rebuilding the project before testing it. Use this option if the project is already built before the test run.
  • -failFails 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 Connecting to Development Testing Platform.
  • -publishteamserverPublishes the report to the Team Server. The Team Server location can be specified in the GUI or in the options file (described in the -localsettings %LOCALSETTINGS_FILE% entry).
  • -report %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.html and an XML report filename.xml.
    • -report filename.xml
    • -report filename.htm
    • -report filename.html

    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.
    If the -report option is not specified, reports will be generated with the default names "report.xml/html" in the current directory.

  • -dtp.autoconfig %PROJECT_NAME@SERVER_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). 
    For example:
    -dtp.autoconfig [email protected]:8080

  • -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.

  • -showdetailsPrints 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.

 

  • -appconsole stdout|% OUTPUT_FILE%Redirects C++test's console output to standard output or an %OUTPUT_FILE% file. 
    Examples:
    -appconsole stdout (console redirected to the standard output)
    -appconsole console.out (console redirected to console.out file)
  • -list-compilersPrints a list of valid compiler family values. 

  • -list-configs - Prints a list of valid Test Configuration values. 

  • -include %PATTERN%, -exclude %PATTERN% - Specifies files to be included/excluded during testing. 
    You must specify a file name or path after this option.
    Patterns specify file names, with the wildcards *and ? accepted, and the special wildcard ** used to specify one or more path name segments. Syntax for the patterns is similar to that of Ant filesets.
    Examples:
    -include **/Bank.cpp (test Bank.cpp files)

    -include **/ATM/Bank/*.cpp (test all .cpp files in folder ATM/Bank)

    -include c:/ATM/Bank/Bank.cpp (test only the c:/ATM/Bank/Bank.cpp file)

    -exclude **/internal/** (test everything except classes that have path with folder "internal")

    -exclude **/*Test.cpp (test everything, but files that end with Test.cpp)

    Additionally if a pattern is a file with a .lst extension, it is treated as a file with a list of patterns.
    For example, if you use -include c:/include.lst and include.lst contains the following (each line is treated as single pattern):
    **/Bank.cpp

    **/ATM/Bank/*.cpp

    c:/ATM/Bank/Bank.cpp

    then it has same effect as specifying:
    -include **/Bank.cpp -include **/ATM/Bank/*.cpp

    -include c:/ATM/Bank/Bank.cpp"

 

 

Options for Importing and Creating Projects

...

Options for Testing Projects Available in the C++test/Eclipse Workbench

 

OptionPurposeNotes

-data %WORKSPACE_DIR%

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 CVS, SVN, Star Team, 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
titleNotes
  • 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.

...

  • Reporting Settings
  • Parasoft DTP Settings
  • Project Center Settings
  • Team Server Settings
  • Licensing Settings
  • Technical Support Settings
  • Authorship/Scope Settings
  • Source Control Settings

 

  • Settings for Creating BDF-Based Projects
  • Settings for Importing Green Hills .gpj Projects
  • Settings for Importing Microsoft Visual Studio 6.0 .dsp Projects

 

  • Miscellaneous Settings
Note
titleNotes
  • Each setting should be entered on a single line.
  • If your options file contains any invalid settings, details will be reported in the command line output.
  • If your are running cli mode from a developer/tester desktop (as opposed to from a Server machine), use the tasks.clear=false option to ensure that your results from previous runs are preserved.

...

SettingPurpose
techsupport.auto_creation=true|false

Determines whether archives are automatically prepared when testing problems occur.

techsupport.send_email=true|false

Determines whether prepared archives are emailed to Parasoft support. If you enable this, be sure to specify email settings from the GUI or with the options in Reporting Settings.

techsupport.archive_location=[directory]Specifies where archives are stored.
techsupport.verbose=true|false

Determines whether verbose logs are included in the archive. Note that this option cannot be enabled if the logging system has custom configurations.

  • Verbose logs are stored in the xtest.log file within the user-home temporary location (on Windows, this is <drive>:\Documents and Settings\<user>\Local Settings\Temp\parasoft\xtest).
  • Verbose logging state is cross-session persistent (restored on application startup).
  • The log file is a rolling file: it won't grow over a certain size, and each time it achieves the maximum size, a backup will be created.
techsupport.verbose.scontrol=true|false

Determines whether verbose logs include output from source control commands. Note that the output could include fragments of your source code.

techsupport.item.general=true|false

Determines whether general application logs are included.

techsupport.item.environment=true|false

Determines whether environment variables, JVM system properties, platform details, additional properties (memory, other) are included in the archive.

techsupport.advanced=true|false

Specifies if advanced options will be sent.

techsupport.advanced.options=[option]

Specifies any advanced options that the support team asked you to enter.

techsupport.dtp.engine=true|falseSpecifies if additional data generated during analysis will be sent.

Authorship/Scope Settings

...

PropertyDescription
scontrol.rep.type=serenaSerena Dimensions repository type identifier.
scontrol.rep.serena.host=Serena Dimensions server host name.
scontrol.rep.serena.dbname=

Name of the database for the product you are working with.

scontrol.rep.serena.dbconn=Connection string for that database.
scontrol.rep.serena.login =Login name.
scontrol.rep.serena.passwordPassword.
scontrol.rep.serena.mapping

Maps workspace resources to Serena Dimension repository paths.

  • Example 1: If you use scontrol.rep.serena.mapping_1=${project_loc\:MyProject};PRODUCT1\:WORKSET1;src\\MyProject, then Project MyProject' will be mapped to the Serena workset PRODUCT1:WORKSET1 and workset relative path: src\\MyProject
  • Example 2: If you use scontrol.rep.serena.mapping_2=${workspace_loc};PRODUCT1\:WORKSET1, then the complete workspace will be mapped to the Serena workset PRODUCT1:WORKSET1.

 

StarTeam Repository Definition Properties

PropertyDescription
scontrol.rep.type=starteamStarTeam repository type identifier.
scontrol.rep.starteam.host=StarTeam server host.
sscontrol.rep.starteam.port=StarTeam server port. Default port is 49201.
scontrol.rep.starteam.login=Login name.
scontrol.rep.starteam.password=Password (not encoded).
scontrol.rep.starteam.path=

When working with large multi-project repositories, you can improve performance by specifying the project, view, or folder that you are currently working with.

You can indicate either a simple Project name (all views will be scanned when searching for the repository path), a Project/View (only the given view will scanned) or Project/View/Folder (only the specified Star Team folder will be scanned).

Examples:
scontrol.rep.starteam.path=proj1

scontrol.rep.starteam.path=proj1/view1

scontrol.rep.starteam.path=proj1/view1/folderA

scontrol.rep.starteam.path=proj1/view1/folderA/folderB

scontrol.rep.starteam.workdir=

If the scontrol.rep.starteam.path setting specifies a StarTeam view or folder, you can use this field to indicate a new working directory for the selected view's root folder (if the path represents a view) or a new working directory for the selected folder (if the path represents a folder).

Examples:

scontrol.rep.starteam.workdir=c:\\storage\\dv

scontrol.rep.starteam.workdir=/home/storage/dv

 

Subversion Repository Definition Properties

...

PropertyDescription
scontrol.rep.type=synergySynergy/CM repository type identifier
scontrol.rep.synergy.host=

Computer on which synergy/cm engine runs. Local host is used when missing. For Web mode, the host must be a valid Synergy Web URL with protocol and port (e.g., http://synergy.server:8400).

scontrol.rep.synergy.dbpath=

Absolute synergy database path e.g \\host\db\name (backslash symbols '\' in UNC/Windows paths must be doubled).

scontrol.rep.synergy.projspec=

Synergy project spec which contains project name and its version e.g name-version.

scontrol.rep.synergy.login=Synergy user name.
scontrol.rep.synergy.password=Synergy password (not encoded).
scontrol.rep.synergy.port=Synergy port.
scontrol.rep.synergy.remote_client=

(UNIX only) Specifies that you want to start ccm as a remote client. Default value is false. Optional. This is not used for Web mode.

scontrol.rep.synergy.local_dbpath=

Specifies the path name to which your database information is copied when you are running a remote client session. If null, then the default location will be used. This is not used for Web mode.

scontrol.synergy.exec=Path to external client executable (ccm)

 

Microsoft Visual Source Safe Repository Definition Properties

...

  • The repository(n).vss.ssdir property should contain a UNC value even if the repository database resides locally.
  • Be aware of VSS Naming Syntax, Conventions and Limitations. Any character can be used for names or labels, except the following:
    • Dollar sign ($)
    • At sign (@)
    • Angle brackets (< >), brackets ([ ]), braces ({ }), and parentheses (( ))
    • Colon (:) and semicolon (;)
    • Equal sign (=)
    • Caret sign (^)
    • Exclamation point (!)
    • Percent sign (%)
    • Question mark (?)
    • Comma (,)
    • Quotation mark (single or double) (' ")
  • VSS 6.0 (build 8163), which is deployed with Visual Studio 6, does not work properly with projects whose names start with a dot (.) symbol. If such a project name is used, subprojects cannot be added.
  • Do not use custom working directories for sub-projects (example: Project $/SomeProject has the working directory C:\TEMP\VSS\SomeProject and its subproject $/SomeProject/SomeSubProject has the working directory D:\SomeSubProject).

 

Settings for Creating BDF-Based Projects

...

Setting
Purpose
hew.import.location=WORKSPACE|ORIG|<path>

Specifies the location of the imported projects.

If WORKSPACE is used, then the project will be created in workspace.

If ORIG is used, then the project will be created in the original project file location.

If an external path is specified, then the project will be created in the specified location.

The default value is WORKSPACE.

hew.import.linked=true|false

Specifies whether the HEW project source folders are linked into the created Eclipse project.

The default value is true.

hew.import.subdirs=true|false

Applicable when hew.import.location=<path>

Specifies whether the project(s) are imported into subdirectories or directly into the specified location.

If you want the project(s) imported into subdirectories created in the specified external location, use true.

If you are importing only one project and you want it imported directly into the specified external location, use false.

The default value is true (subfolders are created for each project imported into in external location).

hew.import.pathvar.enabled=true|false

Specifies if path variables should be used when creating linked directories (if the above option is set to true).

The default value is false.

hew.import.pathvar.name=<name>

Specifies the path variable name. The default value will be used unless you specify a path variable name that points to a different location (for instance, DEVEL_ROOT_DIR).

If a project with the specified name is already defined in the Eclipse workspace and it points to a different location than the value passed in the hew.import.pathvar.location property, then Path Variable will not be used; full paths will be used instead. Also the default value of hew.import.pathvar.name will always be DEVEL_ROOT_DIR if the hew.import.pathvar.name property is not specified. If this property is specified with a <name>, then that <name> will be used as the Path Variable name.

The default value is DEVEL_ROOT_DIR.

hew.import.pathvar.value=<path>Specifies the path variable value. By default, C++test calculates the common root for all linked folders.
hew.import.config=<name>Specifies the name of the build configuration to use.

 

Miscellaneous Settings

Setting
Purpose
report.rules=[url_path_to_rules_directory]

Specifies the directory for rules html files (generated by clicking the Printable Docs button in the Test Configuration’s Static Analysis tab).

For example:

report.rules=file:///C:/Temp/Burt/parasoft/xtest/gendoc/

report.rules=../gendoc/

The default setting is none.

tasks.clear=true|false

Clears existing tasks upon startup in cli mode. This prevents excessive time being spent "loading existing results."

The default is true.

console.verbosity.level=low|normal|high

Specifies the verbosity level for the Console view. Available settings are:

low: Configures the Console view to show errors and basic information about the current step’s name and
status (done, failed, up-to-date).

normal: Also shows command lines and issues reported during test and analysis.

high: Also shows warnings.

cpptest.custom.rules.dir=[directory]

Indicates where user-defined rules are saved.

cpptest.custom.configs.dir=[directory]

Indicates where user-defined Test Configurations are saved.

custom.compilers.dir=[directory]

Overrides the custom compiler directory settings (found in Parasoft> Configurations> Custom compilers) and uses the defined directory to search for custom compilers

parallel.mode=Manual|Auto|Disabled

Determines which of the following modes is active:

  • Auto: Allows Parasoft Test to control parallel processing settings.
  • Manual: Allows you to manually configure parallel processing settings to suit your specific needs.
  • Disabled: Configures Parasoft Test to use only one of the available CPUs.

For more details on this and other parallel processing options, see Configuring Parallel Processing.

parallel.max_threads=<number>

Specifies the maximum number of parallel threads that can be executed simultaneously. The actual number of parallel threads is determined by the number of CPUs, available memory, and license settings.

parallel.free_memory_limit=<percentage>

Specifies the amount of memory that should be kept free in low memory conditions (expressed as a percentage of the total memory available for the application). This is used to ensure that free memory is available for other processes.

parallel.no_memory_limit=true|false

Indicates that you do not want to place any restrictions (beyond existing system limitations) on the memory available to C++test

...

Code Block
# REPORTS
#Determines whether reports are emailed to developers and to the additional recipients specified with the cc setting.
#Remember that if the team is using CVS for source control and each developer's email address matches his or her CVS username + the mail domain, each developer that worked on project code will automatically be sent a report that contains only the errors/results related to his or her work.
report.mail.enabled=true
#Exclude developers emails (true/false)
report.mail.exclude.developers=false
# Append developers errors to manager emails (true/false) report.developer_errors=true
# Send reports to developers (true|false) report.developer_reports=true
# Append suppressed messages (true|false) report.suppressed_msgs=false#Determines where to mail complete test reports.
#This setting is typically used to send reports to managers or architects.
#It can also be used to send reports to developers if developer reports
#are not sent automatically (for example, because the team is not using CVS).
[email protected]; ${env_var:USERNAME} @domain.com
# mail target for unknown developer errors [email protected]
#Specifies the mail server used to send reports.
report.mail.server=mail_server.domain.com
#Specifies the mail domain used to send reports.
report.mail.domain=domain.com
#Specify mali from report.mail.from=nightly
#Specifies any email addresses you do not want to receive reports.
#This setting is used to prevent from automatically sending reports to someone that worked on the code, but should not be receiving reports. This setting is only applicable if the team is using CVS for source control and developer reports are being sent automatically.
report.mail.exclude=developer1;developer2
# Specifies the subject line of the emails sent.
report.mail.subject= ${tool_name} Report - ${config_name}
# Report test params include (true|false)
report.test_params=true
# Team Server
#Determines whether the current installation is connected to the Team Server.
tcm.server.enabled=true
#Specifies the machine name or IP address of the machine running Team Server.
tcm.server.name=team_server.domain.com
#Specifies the Team Server port number.
tcm.server.port=18888
tcm.server.accountLogin=true
tcm.server.username=user
tcm.server.password=password
session.tag= ${config_name}
# Parasoft Project Center
#Determines if the current installation is connected to Parasoft Project Center.
concerto.reporting=true
#Specifies the host name of the Parasoft DTP server.
dtp.server=grs_server.domain.com
# Specifies the port number of the Parasoft Project Center report collector.
concerto.data.port=32323
# Specifies user-defined attributes for Parasoft Project Center.
#Use the format key1:value1; key2:value2
#Attributes help you mark results in ways that are meaningful to your organization.
#They also determine how results are grouped in Parasoft Project Center and how you can filter results in Parasoft Project Center.
#For example, you might want to label results by project name and/or by project component name.
#Each attribute contains two components: a general attribute category name
#and a specific identification value. For example, assume your organization wants to classify results by project.
#You might then use the attribute project:projname1. For the next project, you could use a different
#local settings file that specified an attribute such as project:projname2.
concerto.user_defined_attributes=Type:Nightly;Project:Project1
# Determines whether the results sent to Parasoft Project Center are marked as being from a nightly build.
concerto.log_as_nightly=true
# SCOPE
#code authorship based on CVS
scope.sourcecontrol=true
#code authorship based on author tag
scope.author=false
#code authorship based on local user
scope.local=false
# LICENSE
#override license settings
#cpptest.license.autoconf.timeout=40
cpptest.license.use_network=true
cpptest.license.network.host=license_server.domain.com
cpptest.license.network.port=2222
cpptest.license.network.edition=server_edition
# SOURCE CONTROL
scontrol.rep1.type=cvs
scontrol.rep1.cvs.root=:pserver:developer@cvs_server.domain.com:/home/cvs/
scontrol.rep1.cvs.pass=mypassword

 

Anchor
using_cli
using_cli
Using the cli with an Eclipse-Based Builder

...

Strings of the form $(key) in command arguments are expanded. The values used can be from previous var commands or from System properties. System properties can be predefined by Java (e.g. user.home) or passed into the build by running Eclipse with the -vmargs -Dkey=value parameter.