Go to the first, previous, next, last section, table of contents.


Config Variables

DejaGnu uses a named array in Tcl to hold all the info for each machine. In the case of a canadian cross, this means host information as well as target information. The named array is called target_info, and it has two indices. The following fields are part of the array.

name
The name of the target. (mostly for error messages) This should also be the string used for this target's array. It should also be the same as the linker script so we can find them dynamically. This should be the same as the argument used for push_target{}.
ldflags
This is the linker flags required to produce a fully linked executable. For libgloss supported targets this is usually just the name of the linker script.
config
The target canonical for this target. This is used by some init files to make sure the target is supported.
cflags
The flags required to produce an object file from a source file.
connect
This is the connectmode for this target. This is for both IP and serial connections. Typically this is either telnet, rlogin, or rsh.
target
This is the hostname of the target. This is for TCP/IP based connections, and is also used for version of tip that use /etc/remote.
serial
This is the serial port. This is typically /dev/tty? or com?:.
netport
This is the IP port. This is commonly used for telneting to target boards that are connected to a terminal server. In that case the IP port specifies the which serial port to use.
baud
This is the baud rate for a serial port connection.
x10
This is the parameters for an x10 controller. These are simple devices that let us power cycle or reset a target board remotely.
fileid
This is the fileid or spawn id of of the connection.
prompt
a glob style pattern to recognize the prompt.
abbrev
abbreviation for tool init files.
ioport
This is the port for I/O on dual port systems. In this configuration, the main serial port 0 is usually used for stdin and stdout, which the second serial port can be used for debugging.

The first index into the array is the same value as used in the name field. This is usually a short version of the name of the target board. For an example, here's the settings I use for my Motorola's IDP board and my Motorola 6U VME MVME135-1 board. (both m68k targets)

# IDP board
set target_info(idp,name)       "idp"
set target_info(idp,ldflags)    "-Tidp.ld"
set target_info(idp,config)     m68k-unknown-aout
set target_info(idp,cflags)     ""
set target_info(idp,connect)    telnet
set target_info(idp,target)     "s7"
set target_info(idp,serial)     "tstty7"
set target_info(idp,netport)    "wharfrat:1007"
set target_info(idp,baud)       "9600"
# MVME 135 board
set target_info(idp,name)       "mvme"
set target_info(idp,ldflags)    "-Tmvme.ld"
set target_info(idp,config)     m68k-unknown-aout
set target_info(idp,cflags)     ""
set target_info(idp,connect)    telnet
set target_info(idp,target)     "s8"
set target_info(idp,serial)     "tstty8"
set target_info(idp,netport)    "wharfrat:1008"
set target_info(idp,baud)       "9600"

DejaGnu can use this information to switch between multiple targets in one test run. This is done through the use of the push_target procedure, which is discussed elsewhere.

This array can also hold information for a remote host, which is used when testing a candain cross. In this case, the only thing different is the index is just host. Here's the settings I use to run tests on my NT machine while running DejaGnu on a Unix machine. (in this case a Linux box)

set target_info(host,name)      "nt-host"
set target_info(host,config)    "386-unknown-winnt"
set target_info(host,connect)   "telnet"
set target_info(host,target)    "ripple"

There is more info on how to use these variables in the sections on the config files. See section Master Config File.

In the user editable second section of `site.exp', you can not only override the configuration variables captured in the first section, but also specify default values for all the runtest command line options. Save for `--debug', `--help', and `--version', each command line option has an associated Tcl variable. Use the Tcl set command to specify a new default value (as for the configuration variables). The following table describes the correspondence between command line options and variables you can set in `site.exp'. See section Using runtest, for explanations of the command-line options.


Go to the first, previous, next, last section, table of contents.