You can launch a unit test program on the target and the IDE will display the results of
individual tests in a dedicated view as the program runs.
To run a test program:
-
In the Launch Configuration dropdown, select the project containing the relevant test program.
-
In the Launch Mode dropdown, select Run.
-
In the Launch Target dropdown, select the target for running the test program.
-
Click the Edit button ()
on the right of the Launch Configuration dropdown.
-
In the Main tab of the configuration editor window, enter the path of the test program in
the C/C++ Application field.
-
In the Arguments tab, check the Test Runner checkbox to enable
the test framework selector.
-
In the Tests Runner dropdown, select the framework on which your test program is based.
The IDE can't auto-detect the framework you're using, so you must manually specify one.
-
Click OK to save the configuration changes and close the window.
-
In the launch bar, click the Run button
().
The IDE starts running the unit test program on the target. If necessary, the IDE builds the program before
copying it to the target.
The
Console view displays the raw output of the program while the
C/C++ Unit
view visually presents the test results (based on the IDE's parsing of those results):
The IDE opens this latter view whenever it launches a test program; you can open the view manually by selecting
.
At the top, the IDE illustrates testing progress (in a progress bar) and lists the numbers of completed tests (runs),
errors, and test failures. In the area below, it lists the names and total running times of the program's test cases.
The icon next to each test case name contains a green box with a checkmark if all tests in that test case passed
or a blue box with an X if any test failed.
You can expand a test case entry to see the results of individual tests. When you click a specific test, the bottom area
shows any messages output by the program while that test ran. There are also buttons on the right for filtering
error, warning, and information messages.