runtest
defaults
The site configuration file, `site.exp', captures
configuration-dependent values and propagates them to the DejaGnu test
environment using Tcl variables. This ties the DejaGnu test scripts
into the configure
and make
programs.
DejaGnu supports more than one `site.exp' file. The multiple instances of `site.exp' are loaded in a fixed order built into DejaGnu (the more local last).
runtest
loads
these values first. This master configuration file is created when
DejaGnu is installed. See section Installing DejaGnu. The master `site.exp' can contain the default values for
all targets supported by DejaGnu.
DEJAGNU
to the name of the
file. Anything in the file `$DEJAGNU' overrides the values in the
installed master configuration file.
runtest
loads these values last, the
individual test configuration can either rely on and use, or override,
any of the global values from the "master" `site.exp'.
You can usually generate or update the test-suite `site.exp' by
typing `make site.exp' in the test suite directory, after the test
suite is configured.
You can further override the default values in a user-editable section
of any `site.exp', or by setting variables on the runtest
command line.
All `site.exp' files have two sections, separated by comment text. The first section starts with:
## these variables are automatically generated by make ## # Do not edit here. If you wish to override these values # add them to the last section
Do not edit this first section; if you do, your changes are replaced
next time you run make
. The first section ends with this
line:
## All variables above are generated by configure. Do Not Edit ##
The first section is the part that is generated by make
. It is
essentially a collection of Tcl variable definitions based on
`Makefile' environment variables. Since they are generated by
make
, they contain the values as specified by configure
.
(You can also customize these values by using the `--site' option
to configure
.) In particular, this section contains the
`Makefile' variables for host and target configuration data.
In the second section, you can override any default values (locally to
DejaGnu) for all the variables. The second section can also contain
your preferred defaults for all the command line options to
runtest
. This allows you to easily customize runtest
for
your preferences in each configured test-suite tree, so that you need
not type options repeatedly on the command line. (The second section
may also be empty, if you do not wish to override any defaults.)
It is usually more convenient to keep these "manual overrides" in the `site.exp' local to each test directory, rather than in the "master" `site.exp' in the DejaGnu library.
To override the values captured in the first part of `site.exp' by
configure
and make
, simply set your own value for any of
these variables in the second part of `site.exp'. Set the
variables using the Tcl set
command; for example, to run tests on
an experimental version of GCC, the second part of your
`site.exp' might include:
set CC "/working/devo/gcc/xgcc"
The default values depend on your configuration. The defaults shown are those built into the DejaGnu distribution, which will appear only if your configuration does not change them. (For example, in cross configurations, program names often reflect the target type.)
This example is taken from the template for the global configuration
file installed as the master `site.exp'. You can use the same
format (a Tcl case
statement) for any DejaGnu configuration file.
# # Set defaults for all known targets # case "$target_alias" in { { "native" } { set target_abbrev unix set connectmode "" set targetname "" set netport "" set serialport "" set baud "" } { "m68k-*bug-*" "m68k-mvme135-*" } { # Motorola MVME135 board running Bug monitor set target_abbrev bug set connectmode "tip" set targetname "s8" set serialport "/dev/ttyr8" set netport "wharfrat:20008" set baud "9600" set CFLAGS "-Tmvme135.ld" set CXXFLAGS "-Tmvme135.ld" } }
$target_alias
target_alias
is set by configure
. This
DejaGnu configuration file uses it to choose the default values for a
particular target machine.
m68k-*bug-*
m68k-mvme135-*
target_abbrev
connectmode
runtest
options, for
the list of meaningful values.
targetname
tip
.
serialport
netport
baud
CFLAGS
CXXFLAGS
"-g"
.
The following variables, usually in the local `site.exp' (in test
directories), extend the standard set of configuration variables. You
should never redefine these; they permit runtest
to determine its
configuration at runtime. The examples shown below are from a Sun-4
native configuration.
host_triplet
runtest
. "sparc-sun-sunos4.1.1"
describes a
particular level of Sun4, for example.
target_triplet
runtest
options
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.