Chapter 6. Test Suites

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, for the TX39, MN10300, PowerPC, and ARM7 hardware targets. This is also the way to run tests on the Fujitsu SPARClite Evaluation Board if connecting via a serial line.

  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 12).

  2. Start GDB, using the correct command prefix for your platform (see “GDB and GCC command notation”, page 17).

  3. Set up the baud rate, usually with (gdb) set remotebaud 38400 (this must be 19200 for the SPARClite board).

  4. Select the target board, usually with (gdb) target remote com1 on Windows or (gdb) target remote /dev/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.

When executing test cases on the Fujitsu SPARClite Evaluation Board via an TCP connection to the board, the following steps are required:

  1. Start GDB using the test case file name as an argument.

  2. Connect to the target board with (gdb) target remote xxx:1000 where xxx is the IP address or hostname assigned to the board.

  3. Download the test program with (gdb) load.

  4. Execute the test program with (gdb) continue.

When executing test cases on the Linux synthetic target, it is possible to run them directly from the command line. If debugging is needed, only the following steps are required:

  1. Start GDB using the test case file name as an argument.

  2. Execute the test program with (gdb) run.

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 that 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 10 you will find detailed instructions on running a test case to verify that your hardware board is working with the supplied software.