This topic explains how to prepare C++test to execute your existing manually-written CppUnit test cases. Running CppUnit  test cases in C++test allows you to centralize unit testing and reporting. C++test’s reporting and authorship calculation capabilities help the team track which test cases failed, since when, and who is responsible for fixing each failure.

The team can run these tests in command-line mode each night. For instant feedback on whether their code changes broke the existing functionality, each developer can import the regression failures caused by their modifications. Since the regression failures are directed to the developers responsible for them, the overall process of fixing them is much more streamlined than it would be if all developers were looking at the same list of regression failures.

Additionally, C++test  provides test coverage information for CppUnit test cases and can also perform runtime error detection as they execute.

Sections include:

Accessing the Tests

To configure C++test to access your manually-written CppUnit test cases:

  1. Ensure that the CppUnit test case files are available within the project tree.

      2. Choose Parasoft> Test Configurations to open the Test Configurations dialog.

     3. Select the Test Configurations category that represents the user-defined Test Configuration you want to execute the CppUnit tests.

     4. Open the Execution tab.

     5. In the General subtab, modify the Test suite file search patterns setting as needed so that C++test will locate and test the CppUnit tests.

     6. Click either Apply or Close to commit the modified settings.

The  tests will be executed when you run a test using this Test Configuration.

Requirements/Limitations

The imported test cases must satisfy the following conditions:

Excluding Test Cases from the Build

If a given CppUnit file is not excluded from build, then:

Thus, we recommend excluding CppUnit files from the build. However, it is not required.

To exclude CppUnit files from the build:

  1. Right-click the source file containing the CppUnit  method definitions, then choose Properties from the shortcut menu.
  2. Select the General category on the left (under Configuration Properties).
  3. Use the drop down combo box to change the Excluded From Build setting to Yes.



  4. Right-click  the header file containing the CppUnit class and method declarations, then choose Properties from the shortcut menu.
  5. Select the General category on the left (under Configuration Properties).
  6. Use the drop down combo box to change the "Excluded From Build" setting to Yes.