This topic explains the general procedure for running tests from the C++test GUI.

Sections include:


If you want to exclude designated project resources from the test or test only a designated subset of project resources, you must indicate that before starting the test. See Testing a User-Defined Set of Resources for details.

C++test does not directly test headers unless they are included by a source file under test.

See How do I analyze header files/what files are analyzed? for details.

C++test does perform static analysis and unit testing of instantiated function templates and instantiated members of class templates.

See Support for Template Functions for details.

Running a Test

C++test can perform a variety of tasks, from static analysis, to unit/regression test generation and execution, to exception finding. To start using C++test to achieve your goals, you run a test based on a default or custom test scenario, which defines the precise nature and scope of C++test's analysis. These test scenarios are called "Test Configurations," and they define settings such as test scope, static analysis, test case generation, and test case execution settings.

All preconfigured Test Configurations are described in Built-in Test Configurations. The procedure for creating a custom Test Configuration is the same across the various products in the Parasoft Test family, and is described in Configuring Test Configurations and Rules for Policies.

The general procedure for testing from the GUI is as follows:

  1. In the Eclipse C/C++ Projects view (a.k.a. "the project tree"), select the resource(s) that you want to test.You can use Ctrl + click or Shift + click to select multiple resources.

For Running any Test Configuration

If a Test Configuration is "grayed out," this indicated that it was created with an incompatible version of C++test, and cannot be applied with the current version.

For Running the #1 Favorite Test Configuration

For Running Other Favorite Test Configurations

C++test will then run the test scenario defined by the selected Test Configuration.

For unit testing, we recommend that you run multiple Test Configurations in the following order:

  • Generate Unit Tests
  • Generate Stubs
  • Build Test Executable
  • Run Unit Tests

See Generating Test Cases for Regression Testing and Exception Finding and Executing Test Cases for details.

Reviewing Results

Test progress and results summaries will be reported in the Test Progress tab that C++test opens when it starts the test. Detailed results will be reported in the Quality Tasks view, which can be opened by choosing Parasoft> Show View> Quality Tasks. Drill down to see details about the test findings.

The general procedure for reviewing results (as well as generating reports) is the same across the various products in the Parasoft Test family, and is described in the Reviewing Results.

Fine-Tuning Test Settings

To change test settings — such as what rules are checked, how test cases are generated, whether coverage is tracked, etc.— edit an existing Test Configuration or create a new one, then run a test using the modified/new Test Configuration. Test Configurations and all related parameters can be viewed, edited, and modified in the Test Configurations dialog. To open this dialog, choose Parasoft> Test Configurations from the menu bar.

For the general procedure for configuring Test Configurations, see the Configuring Test Configurations and Rules for Policies.

For details on Test Configuration settings available for C++test, see Configuring Test Configurations.

Testing a User-Defined Set of Resources

To test a user-defined set of resources in C++test:

Excluding Project Resources from Testing

If you do not want all files to be analyzed/tested (for instance, to prevent the checking of automaticallygenerated files), you can exclude project resources from testing. To indicate which project resources should not be tested:

  1. In the project tree, right-click the project that contains the files that you want excluded.
  2. Choose Properties from the shortcut menu, then select the Parasoft> C++test> Scope Settings category in the left pane.

  3. Use the available controls to indicate which specific resources you want to skip and/or exclusion patterns that specify the set of resources you want to skip.

        4. Click OK or Apply.

If you share your project via source control, these preferences will be shared across the team (preferences are saved in the .parasoft project definition file).