This topic explains how to create and share custom Test Configurations (and any rule files or rule mapping files that they depend on) across the team.

Sections include:


About Test Configurations

Every test run of C++test —both in the GUI or from the command line interface—is based on a test configuration that defines a test scenario and sets all related test parameters. You can perform testing with built-in test configurations shipped with C/C++test that are based a variety of popular test scenarios. Alternatively, you can create a custom test configuration by duplicating one of the built-in test configurations and modifying the duplicate, or by creating a new test configuration from scratch; see Creating a Custom Test Configuration. Test configurations that are created and stored on your DTP server can only be customized directly on DTP; see DTP Test Configurations.

For your convenience, you can configure a Favorite test configuration that you plan to use most frequently. The Favorite test configuration defines the default test scenario and can easily be run from the Parasoft menu, with the Test Using tool bar button, or from the command line interface; see Setting the Favorite Test Configuration.

Setting the Favorite Test Configuration

Setting a test configuration as Favorite makes it easily accessible in the Parasoft menu and the toolbar in your IDE to facilitate execution of your most frequent scenarios. In addition, the Favorite test configuration defines the default test scenario for command line execution.

You can specify more than one Favorite test configuration to configure easy access to test configurations you frequently use. C/C++test assumes that the test configuration with the highest position in the Favorite hierarchy is the default for command line use and for the Run Tests toolbar button.

To specify the Favorite test configuration:

  1. Choose Parasoft> Test Configurations from the IDE menu or Test Configurations from drop-down menu on the Run Tests toolbar button to open the Test Configurations panel.
  2. Right-click the test configuration you want to set as Favorite.
  3. Choose Set As Favorite from the context menu.
  4. Specify the position of the test configuration:
    - F: indicates the highest priority and the default scenario; this test configuration will be marked with the 'F' icon
    - 1-3: indicates the order in which the Favorite test configurations will appear in the GUI (Test Using buttons, the Run Tests button menu)

Creating a Custom Test Configuration

You cannot directly modify built-in test configurations shipped with C/C++test. To create a custom test configuration, duplicate an existing test configuration and modify the duplicate in the User-defined category.

(info) Test configurations that are created and stored on your DTP server can only be customized directly on DTP.

To create a custom test configuration:

  1. Choose Parasoft> Test Configurations from the IDE menu or Test Configurations from drop-down menu on the Run Tests toolbar button to open the Test Configurations panel.
  2. Review the available test configurations and do one of the following:
    • To create a custom test configuration based on an existing test configuration: select and right-click the existing test configuration, then choose Duplicate.
    • To create a custom test configuration from scratch: click New.
    The duplicated or newly created test configuration will be added to the 'User-defined' category in the test configuration tree.
  3. Select the new test configuration.
  4. Modify the settings as needed; see Configuring Test Configurations for information about settings available in each tab.
  5. (Optional) Set the Test Configuration as the Favorite test configuration; see Setting the Favorite Test Configuration.
  6. Click Apply.
  7. Click Close.

"Grayed-Out" Test Configurations = Incompatible Test Configurations

If a test configuration is "grayed out," this indicates that it was created with an incompatible C/C++test version, and cannot be edited or run with the current version.

Deploying Test Configurations Across the Team

You can deploy test configurations across the team via DTP, a primary platform for sharing and configuring team configurations, or by manually exporting and then importing a test configuration.

DTP Test Configurations

If C/C++test is connected to DTP, you can analyze your code according to test configurations that are stored on the DTP server you have specified (see Connecting to DTP).


(info) Test configurations that are created and stored on your DTP server can only be customized directly on DTP.

To customize a DTP test configuration:

  1. Choose Parasoft> Test Configurations from the IDE menu or Test Configurations from drop-down menu on the Run Tests toolbar button to open the Test Configurations panel.
  2. Select the DTP category to view test configurations that are available on your DTP.
  3. Click the test configuration you want to modify.
  4. Click the Configure in DTP link to open the Test Configuration page in your DTP interface.

See the Test Configurations section in the Parasoft DTP User Guide for details about adding, configuring, and managing test configurations on DTP.

Importing/Exporting Test Configurations

If you want to share a custom test configuration with other team members or use it in an upgraded version of C/C++test, you can export this test configuration to a .properties file that can then be imported by another team member(s).

Exporting

To export a test configuration:

  1. Choose Parasoft> Test Configurations from the IDE menu or Test Configurations from drop-down menu on the Run Tests toolbar button to open the Test Configurations panel.
  2. Right-click the test configuration you want to export.
  3. Choose Export from the context menu, then use the file chooser to indicate where you want to save the .properties file that will be created for this test configuration.
  4. Click Save. A dialog box will open to confirm the location of the newly created .properties file. 

Importing

To import a test configuration from a .properties file:

  1. Choose Parasoft> Test Configurations from the IDE menu or Test Configurations from drop-down menu on the Run Tests toolbar button to open the Test Configurations panel.
  2. Right-click the User-defined category.
  3. Choose Import from the context menu to open a file chooser.
  4. Navigate to the .properties file of the test configuration you want to import.
  5. Click Open.

Test Configurations – Advanced Topics

Organizing User and Team Test Configurations into Subdirectories

You can organize your user and team test configurations into user-defined subdirectories.

To move a user or team test configuration to a user-defined subdirectory:

  1. Choose Parasoft> Test Configurations from the IDE menu or Test Configurations from drop-down menu on the Run Tests toolbar button to open the Test Configurations panel.
  2. Right-click the test configuration you want to move to a subdirectory.
  3. Choose Set Folder from the context menu.
  4. Specify the subdirectory or subdirectories and click OK. In the following example, the test configuration is moved to the 'Security' subdirectory:


(info)  Do NOT provide the path to the subdirectory in the command line mode. Subdirectories do not affect command line execution. In the above example, you can specify the following test configuration: -config "team://Policy Compliance"

Specifying Test Configuration Inheritance

If you want multiple test configurations to share some parameter settings (for example, if you want multiple test configurations to have the same rules enabled), you can create new child test configurations referring to one parent test configuration. A child test configuration will inherit the parent’s settings; the value of each preference in the parent test configuration is used whenever the corresponding preference in the child test configuration is not configured.  

Inheritance is recursive. For example, if MyConfig2 test configuration inherits the settings from MyConfig1 and MyConfig3 inherits the settings from MyConfig 2, then MyConfig3 will inherits some MyConfig1 settings, because it inherits MyConfig2 settings.

You can create a child test configuration from a test configuration displayed in the test configuration panel, or by specifying the URL of the test configuration (if the test configurations is available via HTTP).

To create a child from a test configuration displayed in the test configuration panel:

  1. Open the Test Configurations panel.
  2. Right-click the desired parent Test Configuration.
  3. Choose New Child from the context menu.

To create a child from a test configuration available via HTTP:

  1. Open the Test Configurations panel.
  2. Right-click the User-Defined node.
  3. Choose New Child from the context menu.
  4. In the dialog that opens, enter the URL for the desired parent Test Configuration (http://config_address). For example:
    http://SOAtest.acme.com/configs/static.properties

To disconnect a child from its parent:

  1. Open the Test Configurations panel.
  2. Click the Disconnect button to the right of the Parent field.

Important Notes

  • Once a parent-child relationship is set, that correlation cannot be modified. For example, if test configuration A is the parent of test configuration Z, you cannot switch test configuration Z’s parent to test configuration B. 
  • Once a child test configuration is disconnected from its parent, it cannot be reconnected. All the inherited settings are applied directly in the child when disconnected.
  • A given test configuration may have only one parent configuration. Multiple inheritance is not supported.

Comparing Test Configurations Using the Test Configurations Panel

If you want to see the differences between two test configurations, you can compare them to highlight the differences. You may want to compare test configurations if:

  • You customized a built-in static test configuration from a previous product version and want to verify what new rules have been added and enabled in the most current version of that built-in test configuration.
  • You want to verify what settings will be affected if you run a given test configuration in "Quick Mode."
  • You want to verify the differences between a child test configuration and its parent.

To compare any two test configurations displayed in the Test Configurations panel.

  1. Select two test configurations.
  2. Right-click the selection.
  3. Choose Compare.

To compare a child Test Configuration with its parent:

  1. Right-click the child test configuration.
  2. Choose Compare with> Parent Configuration.

To compare a child test configuration with the corresponding test configuration in the Quick Mode:

  1. Right-click the child test configuration.
  2. Choose Compare with> Quick Mode Configuration.

Changes will be highlighted in the comparison editor that opens.


Comparint test configurations allows you to identify both the differences that are apparent within the panel (for example, when a setting is disabled in one test configuration and enabled in the other), as well as differences on a lower lever, such as different rule parametrization.

  • No labels