Additional and included files

Component Testing for C++

When creating a Component Testing test node for C++, the Component Testing wizard offers the following options for specifying dependencies of the source code under test:

Additional Files

Additional source files are source files that are required by the test script, but not actually tested. For example, with Component Testing for C++, Visual C++ resource files can be compiled inside a test node by specifying them as additional files.

Additional header files (.h) are not handled in the same way as additional body files (.cc, .C, or .cpp):

You can toggle a source file from under test to additional by changing the Instrumentation property in the Properties Window dialog box.

Additional directories are directories that are declared to only contain additional source files.

Functions which are not located  in an additional file or in a tested file are simulated by Component Testing for C++.

Included Files

Included files are normal source files under test. However, instead of being compiled separately during the test, they are included and compiled with the C++ Test Driver script.

Header files are automatically considered as included files, even if they are not specified as such.

Source files under test should be specified as included when:

In most cases, you do not have to specify files to be included. The Component Testing wizard automatically generates a warning message in the Output Window, when it detects files that should be specified as included files. If this occurs, rerun the Component Testing wizard, and select the files to be included in the Include source files section of the Advanced Options dialog box.

To specify included files while creating a test node:

  1. Select a valid C++ configuration and run the Component Testing wizard.

  2. On the Test Script Generation Settings page (Step 3/5), expand Components Under Test and <Test Name>. where <Test Name> is the name of the Test Node.

  3. Scroll down the list to Included Files, select the value field and click the '...' button to enter a list of files.

  4. Enter any other advanced settings and continue with the Component Testing wizard.

To specify additional files while creating a test node:

  1. Select a valid C++ configuration and run the Component Testing wizard.

  2. On the Test Script Generation Settings page (Step 3/5), select General and switch the Test Mode setting to Expert Mode.

  3. Expand Components Under Test and select Test Boundaries.

  4. Under Additional Files or Directories, select the value field and click the '...' button to enter a list of files or directories

  5. Enter any other advanced settings and continue with the Component Testing wizard.

Related Topics

Files and Classes Under TestComponent Testing WizardAdvanced Options