Page tree

Skip to end of metadata
Go to start of metadata

This topic provides an overview of the different ways that you can extend and modify the automatically generated unit test suite.

Use the following table as a reference to determine which test suite extension/modification methods are best suited to your goals

To achieve thisDo thisReference
Add new  test cases to check specific unit-level functionality requirements or to improve coverageUse the Test Case Wizard to create test cases graphically, or add  code to test case templatesAdding User-Defined Test Cases
Modify automatically-generated test cases to check specific unit-level functionality requirements or to improve coverageEdit the related test filesAdding User-Defined Test Cases
Modify test generation or execution settingsConfigure settings in the Test Configuration panel’s Generation and Execution tabsGeneration Tab Settings: Defining How Test Cases are Generated and
Execution Tab Settings - Defining How Tests are Executed
Remove test cases and disable outcome checks or test cases that are not currently of concern to you

To remove a test suite: Right-click its Test Case Explorer node and choose Delete

To remove a test case: Right-click its Test Case Explorer node and choose Delete

To disable checking of a specific outcome: Right-click the unverified outcome in the Quality Tasks view, then choose Ignore Outcome from the shortcut menu

To disable a complete test case: Right-click its Test Case Explorer node and choose Disable

Deleting and Disabling Tests
Prevent the testing of certain classes or methodsSpecify the resources that you want to include or excludeTesting a User-Defined Set of Resources
Convert automatically generated tests into a
"functional snapshot" for regression testing (to identify changes/problems introduce by code modifications)
If the code is behaving correctly, right-click the unverified outcome node, then choose Verify Outcome from the shortcut menuVerifying Test Cases for Regression Testing
Access data source values during testingConfigure test cases to access values stored in a data source.Using Data From Data Sources to Parameterize Test Cases
Use standard I/O data in test casesAdd C++test Stream API calls for redirecting standard input/output streamUsing Data From Standard IO
Define custom stubs (to specify what values an external method/function returns to the class under test)Use the Stub wizard to create a stubs framework, then customize it.Adding and Modifying Stubs
Execute existing unit test cases (i.e., CppUnit test cases) using C++testEnsure that your preferred test execution Test Configuration can find the test casesExecuting Manually-Written CppUnit Test Cases
  • No labels