Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [doc/] [testing.txt] - Rev 824

Compare with Previous | Blame | View Log

                            OpenRISC Test Scripts


The standard GNU tool chain regression is quite capable of running on multiple
remote targets.

However it does not include a facility to restart individual threads of
testing if a target fails. It is thus unsuitable for remote targets which are
in some respect unreliable.

The script fixes this. It uses the standard GNU tool chain
DejaGnu test framework. However it does its own partitioning of threads. As
each thread completes, it then tests that the remote target is still alive,
and if not it marks that target as unavailable and repeats the test.

Under simulation it is also appropriate to use finer grain parallelism than is
available under the standard GNU toolchain test framework.


The tests require DejaGnu to be installed, and assume that the standard
OpenRISC build hierarchy (as used by is adopted.

DejaGnu Test Framework

Board specifications are provided in the boards directory.

Testing of the or32-linux tool chain uses multiple remote targets with telnet
and FTP. The target may be physical hardware or software simulations
implementing Ethernet and running FTP and telnet daemons. The standard DejaGnu
scripts are incomplete for telnet and have errors for FTP, so the board
definition includes missing and fixed expect/TCL code to fix this.

The test script expects the DEJAGNU environment variable to point to the
site.exp file in the main or32 directory (the one containing the boards
directory). It uses the script in that directory to obtain the IP
address of the next available remote target for testing.

The list of target IP addresses is placed in the file ${DEJAGNU}/ip-avail.txt.

Linux Configuration

The standard Linux configuration for OpenRISC does not start an FTP
daemon. Modify arch/openrisc/support/initramfs/etc/inetd.conf as follows:

  telnet stream tcp nowait root /usr/sbin/telnetd telnetd -i
  ftp stream tcp nowait root ftpd ftpd -w /

The test scripts expect a /tmp directory to be present, so create this as

The test scripts FTP programs into the root directory. However telnet logs in
as root, with a home directory in /root. Fix this by editing
arch/openrisc/support/initramfs/etc/passwd to read


Remember to rebuild Linux after these changes.

Board Configuration

The or32-linux-sim.exp script in the boards directory sets various
parameters, which may need adjusting. In particular it specifies the absolute
location of the C and C++ compilers and gives timeouts for command execution
(1200 seconds) and FTP upload/download (both 120 seconds).

Check the function "set_globals" to ensure that the various files and
directories are correct.

The main function is "run_tool_tests". The first argument is the tool test
directory, the second the tool source directory, the third the tool name and
the remaining arguments a list of test thread specifications.

Each test thread specification takes the form:

  <thread name>#<runtest target>

A runtest target is typically an expect script, qualified by the names of
specific source files and/or directories to be tested, for example


The default script runs all the tests for gcc, g++ and libstdc++-v3 (using
three calls to "run-tool_tests". Edit the file to adjust this.

Having set up ip-avail.txt, the script is then run as:



To increase the diagnostic output, find the "runtest" command in and add "-v" to its options (for even more output add "-v -v"
or even "-v -v -v").

Note this is useful for debugging the test scripts rather than actual tests

Supplementary Scripts
===================== leaves each tests results in its own log and summary
files. The script collates all the results. For example

  ./ bd-linux/or32-linux/libstdc++-v3/testsuite/libstdc++/*.log

It is sometimes useful to see how long each test thread took. This may lead to
adjustment in partitioning of the tests. This can be achieved with the script. For example:

  ./ bd-linux/or32-linux/libstdc++-v3/testsuite/libstdc++/*.log


Suggestions for improvements always welcome.

Jeremy Bennett <>
3 June 2011

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2021, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.