To run unit testing:

  1. 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).
  2. 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
  3. If you want to automatically generate stubs, run the "Generate Stubs" Test Configuration.
  4. 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.
  5. If needed, modify the selected Test Configuration’s test flow as follows:
    1. Open the Test Configuration manager, select your chosen Test Configuration from Builtin> Embedded Systems> IAR Systems, and duplicate it.
    2. In the duplicated Test Configuration, open the Execution tab and adjust the appropriate properties in the table below the Test execution flow list.
    3. 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".
  6. Click Apply to apply the changes.
  7. 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.

  • No labels