Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CPPTDESKDEV and version 2020.1

Anchor
adding_case
adding_case
C++test provides several ways to add user-defined test cases:

  • Test Case Editor - Use the Test Case Editor to create test cases without writing source code. The editor operates on predefined steps that represent typical actions inside the test case. It enables you to build the test case structure, specify input parameters, and define output expectations. You can save and modify test cases created with the Test Case Editor to easily maintain your tests.
  • Test Case Wizard - Use the Test Case Wizard for black box testing of new code. It provides a simple way to specify inputs and expected outputs, and it offers a better analysis of the tested code’s data dependencies (e.g. global variables), which facilitates test case setup. Using the Test Case Wizard is the only way to automatically generate a data source template for a test case.
    • A potential drawback of the Test Case Wizard is that you can only create one test at a time.
  • Automated test case generation - This is designed to facilitate rapid development of a large number of customizable/extensible tests in bulk. This approach supports characterization testing on volumes of existing code, where tests are generated for many functions at once, and results of tests need to be captured automatically.
    • A potential drawback to automated test case generation is that editing is required to control test case values.
  • Test Suite Wizard - This enables you to quickly create a form for writing complex test code that complies with the C++test test framework.
    • A potential drawback of using the Test Suite Wizard is that the code needs to be added to the template.

This chapter describes how to extend the test suite by adding new test cases via a graphical editor. The following information is included:

Children Display

The test suite can also be extended with your existing unit test cases (i.e., CppUnit test cases); this is described in Executing Manually-Written CppUnit Test Cases.