In this section:
Overview
Test configurations define how your code is analyzed and tested, including which static analysis rules are enabled, which tests to run, and other analysis parameters. Jtest ships with built-in test configurations, but users can create and store their own test configurations in the DTP server (see the DTP documentation for details).
User-defined test configurations that are stored in DTP can be downloaded from the DTP server and stored in the <INSTALL_DIR>\configs\user directory as *.properties files.
Running a Test Configuration
You can specify which configuration will be run in one of the following ways:
Run
jtestcli
with the-config
switch and specify a built-in, user-defined or DTP-hosted test configuration:-config "builtin://Recommended Rules" -config "user://Foo Configuration" -config "dtp://Foo Team Configuration" -config "dtp://FooTeamConfig.properties"
Alternatively, you can add the prefix of the Parasoft tool you are using to specify a DTP-hosted test configuration:
-config "jtest.dtp://Foo Team Configuration"
You can also provide a path or URL to the test configuration .properties file:
-config "C:\Devel\Configs\FooConfig.properties" -config "http://foo.bar.com/configs/FoodConfig.properties"
For example, your command line may resemble the following:jtestcli -config "user://Configuration Name"
In the .properties file, specify the default configuration that will be run when the
-config
option is not used:jtest.config=user://Configuration Name
Ant and Maven Pattern
If you use Ant or Maven, you can specify the test configuration with the following pattern:
<config>user://Configuration Name</config>
Settings Property Pattern
jtest.config=user://Configuration Name
Viewing Available Test Configurations
Use the -listconfigs
switch to print the available test configurations.
Use arguments to filter configurations; the use of "*" expressions is supported
-listconfigs
- prints all available configurations-listconfigs builtin
- prints all built-in configurations-listconfigs builtin*Secure*
- prints all built-in configurations that contain "secure" in the name
Built-in Test Configurations
See Built-in Test Configurations for information about available built-in test configurations.
Creating Custom Rules
Use RuleWizard to create custom rules. See the RuleWizard User Guide for information about RuleWizard capabilities and usage.
To use the rule, it needs to be enabled in a test configuration and the custom rule file must be located in one of the following directories:
- <INSTALL_DIR>rules\user\
- <DOCUMENTS_DIR>\Parasoft\[tool_name]\rules where <DOCUMENTS_DIR> refers to the "My Documents" directory on Windows.