Chapter 6. A note on testing

The eCos kernel and other packages have test suites which rigorously exercise the available features and confirm correct execution. The tests are run on many different possible configurations — the total number of permutations makes it impossible to test them all. The use of test suites is particularly important for embedded systems, where software robustness is a priority. All eCos software is tested prior to shipping, but if you define your own configuration, you will probably want to verify that the test cases work for it.

This release includes test suites for the eCos kernel, kernel C API, C library, µITRON compatibility, and device driver packages. The use of the test suites is similar for all packages. The tests are supplied both as prebuilt images (if you have the CD distribution of the eCos Developer's Kit) and as source code for building with specific eCos configurations.

Each test suite consists of a number of test cases which must be executed individually by following these steps:

  1. Compile and link the test cases with the appropriately configured eCos packages, using the Configuration Tool's Build menu and choosing the Tests item, or by typing make tests (further details in Chapter 14).

  2. Start GDB.

  3. Set up the baud rate, usually with (gdb) set remotebaud 38400.

  4. Select the target board, usually with (gdb) target remote com1 on Windows or (gdb) target remote ttyS0 on Linux.

  5. Download the test program, usually with (gdb) load. This can take some time.

  6. Execute the test program, usually with (gdb) continue.

Each test case runs without further intervention. A test case may involve one or more individual tests. Successful completion of each test within the test case is reported as a line of text which is sent to the diagnostic channel (usually the serial port) for display on a terminal or terminal emulator.

Each test case runs only once and usually requires the target hardware to be reset on completion. Note that certain test cases may not terminate immediately, especially if they involve delays and run on the target simulators.

In the CD distribution of the eCos Developer's Kit, the test cases are located in the following directories:

In the section called Verification in Chapter 12 you will find detailed instructions on running a test case to verify that your hardware board is working with the supplied software.