To run unit testing:
- Select the Navigator node that represents the resource(s) you want to test (a single file, a selection of multiple files, or the entire project).
- If you do not already have your test suites prepared (or if you want to add more automatically-generated test cases) run the "Generate Unit Tests" Test Configuration
- If you want to automatically generate stubs, run the "Generate Stubs" Test Configuration.
- Decide which one of the built-in Test Configurations for launching tests best suits your needs: "Run IAR <arch> Tests" or "Run IAR EW Tests (Batch Template)". See the Support Overview for help.
- If needed, modify the selected Test Configuration’s test flow as follows:
- Open the Test Configuration manager, select your chosen Test Configuration from Builtin> Embedded Systems> IAR Systems, and duplicate it.
- In the duplicated Test Configuration, open the Execution tab and adjust the appropriate properties in the table below the Test execution flow list.
- Edit the properties as follows:
- For the "Execute tests on IAR C-SPY Simulator" flow, review and adjust the "Toolkit binaries location" and "C-SPY execution backend options"settings.
- For "Execute tests on IAR C-SPY Simulator using EW-generated batch script template" provide the "Original IAR EW project location" and review the "Original IAR EW project name" location.
- For "Build and run tests on IAR C-SPY Simulator using EW-generated batch script template" or "Build and run application on IAR C-SPY Simulator using EW-generated batch script template" Test Flows and more recent EW versions provide the "IAR EW project Build Configuration".
- For "Build and run tests on IAR C-SPY Simulator using EW-generated batch script template" or "Build and run application on IAR C-SPY Simulator using EW-generated batch script template" Test Flows and old EW versions, set "Adjust CSpyBat command" to "true".
- Click Apply to apply the changes.
- Select the Navigator node that represents the resource(s) you want to test (a single file, a selection of multiple files, or the entire project), then run the new Test Configuration.
Debugging Test Cases
C++test does not support direct Test Cases debugging for this environment.
Use "Externally built executable" Embedded Workbench project type and set breakpoints on wanted Test Cases manually.