This topic explains how to create and run a test executable, then review results in the C++test GUI.
Sections include:
To generate test cases:
For most supported targets/platforms, the process of building the Test Executable is just a part of an appropriate "Run..."-like Test Flow.
There are few cases where it's convenient to have a separate "Build..."-like Test Configuration and the associated Test Flow. It's generally best to follow the suggested strategy for your platform. For platforms where the full "build, run, read results" flow is normally provided, use the separate build Test Configurations only in special cases—for example, when automatic executable-to-target loading isn't supported, or when you need only the static coverage data (data collected while building the test executable—without execution).
Such Test Configurations may be created by extracting the build-portions from the original Test Flows of the original Test Configuration or user-adjusted Test Configurations. In many cases, you need to adjust one of the provided builtin Test Configurations to make it work for you—creating a new user configuration. In other cases, you can just use the builtin original Test Configuration.
There are several ways to build the test executable:
Information on the Test Flow and its adjustment can be found in Customizing the Test Execution Flow.
Important Instrumentation Setting ConsiderationsBuild process and subsequent execution are strongly affected by the instrumentation features accessible on the "Test Configurations> Execution" tab (see Fine-Tuning Test Settings for details. In embedded solutions, it's often convenient—or even required—to disable instrumentation of specific sources (for instance, containing startup code or interrupt-handling code). This may be achieved through the "Parasoft> C++test> Execution Settings..." context menu (right-click) action, which is available in the project tree; see Execution (File-Level Only) for details. |
If your test execution flow does not automatically deploy the test executable to the target device, start it, and/or read and display results in the GUI, you need to complete the necessary actions manually.
Tips for reading and displaying results via the file communication channel:
"Cannot find test log file. ...failed" MessageIf you receive this message, it may mean that 1) the test executable did not run correctly or 2) Test log files were not available in the expected location. In the latter case, the log files need to be transferred to the expected location OR the expected location needs to be changed to match the actual location. |
For some embedded environments, you can debug test cases directly in C++test. There are two modes for debugging test cases: 1) Internal mode and 2) External Embedded mode. For environments that C++test does not directly support test case debugging, you must exploit debugging methods for externally built executables provided by your environment (if available) and manually set breakpoints on wanted test cases. Check environment-specific chapters to see if C++test directly supports Test Cases debugging for your environment.
We strongly recommend using the built-in Test Configurations for particular embedded environments and making adjustments as necessary. See Executing Tests with a Debugger for instructions.
SeeDebugging in Eclipse Internal Debugger Mode, for additional information.
You can switch to External Native mode by modifying the test configuration. This mode is only used for debugging native applications. After switching to External Native mode, you must also modify the Test Flow recipe to enable External Embedded debugging mode: