Getting Started with eCosTM
Prev |  | Next

# 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:

- one prebuilt testsuite compiled for RAM start-up (needs CygMon or an eCos GDB stub in ROM, and will only run on real hardware): ``BASE_DIR`/prebuilt/v1_2_1/mn10300-stdeval-ram` for the MN10300, ``BASE_DIR`/prebuilt/v1_2_1/tx39-jmr3904-ram` for the TX39, ``BASE_DIR`/prebuilt/v1_2_1/powerpc-cogent-ram` for the PowerPC, ``BASE_DIR`/prebuilt/v1_2_1/sparclite-sleb-ram` for the SPARClite, and ``BASE_DIR`/prebuilt/v1_2_1/arm-pid-ram` for the ARM7.

- one prebuilt testsuite compiled for ROM start-up (will work in real hardware and in the simulator): ``BASE_DIR`/prebuilt/v1_2_1/mn10300-stdeval-rom` for the MN10300, ``BASE_DIR`/prebuilt/v1_2_1/tx39-jmr3904-rom` for the TX39, ``BASE_DIR`/prebuilt/v1_2_1/powerpc-cogent-rom` for the PowerPC.

  > Note: The PowerPC ROM tests do not work with the simulator, but they do work if blown into a PROM or if used with a PROM emulator.

- one prebuilt synthetic target testsuite (will work on Linux only): ``BASE_DIR`/prebuilt/v1_2_1/linux-i386` for i386.

- test case source code is under the base source directory ``BASE_DIR`/packages/`:

  - `compat/uitron/v1_2_1/tests`

  - `io/serial/v1_2_1/tests`

  - `hal/powerpc/arch/v1_2_1/tests`

  - `devs/wallclock/v1_2_1/tests`

  - `devs/watchdog/v1_2_1/tests`

  - `kernel/v1_2_1/tests`

  - `language/c/libc/v1_2_1/tests`

  - `language/c/libm/v1_2_1/tests`

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.

Prev | Home | Next
Reporting Problems | Up | eCos start-up configurations