4 >Customizing DejaGnu
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.44"><LINK
10 HREF=
"book1.html"><LINK
12 TITLE=
"The files DejaGnu produces."
13 HREF=
"outputfiles.html"><LINK
15 TITLE=
"Global Config File"
16 HREF=
"global.html"></HEAD
29 >DejaGnu: The GNU Testing Framework
</TH
37 HREF=
"outputfiles.html"
63 >Chapter
3. Customizing DejaGnu
</A
74 HREF=
"customizing.html#LOCAL"
80 >Global Config File
</A
84 HREF=
"boardconfig.html"
90 >Remote Host Testing
</A
94 HREF=
"configfile.html"
95 >Config File Values
</A
100 >The site configuration file,
<TT
104 captures configuration-dependent values and propagates them to the
105 DejaGnu test environment using Tcl variables. This ties the
106 DejaGnu test scripts into the
<B
113 > programs. If this file is setup correctly,
114 it is possible to execute a test suite merely by typing
120 >DejaGnu supports two
<TT
124 files. The multiple instances of
<TT
128 loaded in a fixed order built into DejaGnu. The first file loaded
129 is the local file
<TT
137 pointed to by the
<SPAN
143 >There is an optional
<I
150 >, capturing configuration values that
151 apply to DejaGnu across the board, in each configuration-specific
152 subdirectory of the DejaGnu library directory.
156 > loads these values first. The master
160 > contains the default values for all
161 targets and hosts supported by DejaGnu. This master file is
162 identified by setting the environment variable
166 > to the name of the file. This is also
167 refered to as the ``global'' config file.
</P
169 >Any directory containing a configured test suite also has a
173 >, capturing configuration values
174 specific to the tool under test. Since
<B
178 loads these values last, the individual test configuration can
179 either rely on and use, or override, any of the global values from
185 >You can usually generate or update the testsuite's local
193 > in the test suite directory, after the test
194 suite is configured.
</P
196 >You can also have a file in your home directory called
200 >. This gets loaded first before the
201 other config files. Usually this is used for personal stuff, like
205 > so all the output gets
206 printed, or your own verbosity levels. This file is usually
207 restricted to setting command line options.
</P
209 >You can further override the default values in a
210 user-editable section of any
<TT
214 setting variables on the
<B
225 >Local Config File
</A
228 >It is usually more convenient to keep these
<I
236 local to each test directory, rather than in the global
240 > in the installed DejaGnu
241 library. This file is mostly for supplying tool specific info
242 that is required by the test suite.
</P
248 two sections, separated by comment text. The first section is
249 the part that is generated by
<B
253 essentially a collection of Tcl variable definitions based on
257 > environment variables. Since they
262 values as specified by
<B
266 also customize these values by using the
<TT
273 >.) In particular, this
274 section contains the
<TT
278 variables for host and target configuration data. Do not edit
279 this first section; if you do, your changes are replaced next
288 >Example
3-
1. The first section starts with
</B
297 CLASS=
"PROGRAMLISTING"
298 > ## these variables are automatically generated by make ##
299 # Do not edit here. If you wish to override these values
300 # add them to the last section
307 >In the second section, you can override any default values
308 (locally to DejaGnu) for all the variables. The second section
309 can also contain your preferred defaults for all the command
313 >. This allows you to
317 > for your preferences
318 in each configured test-suite tree, so that you need not type
319 options repeatedly on the command line. (The second section may
320 also be empty, if you do not wish to override any defaults.)
</P
325 >Example
3-
2. The first section ends with this line
</B
334 CLASS=
"PROGRAMLISTING"
335 > ## All variables above are generated by configure. Do Not Edit ##
342 >You can make any changes under this line. If you wish to
343 redefine a variable in the top section, then just put a
344 duplicate value in this second section. Usually the values
345 defined in this config file are related to the configuration of
346 the test run. This is the ideal place to set the variables
356 >target_triplet
</SPAN
357 >. All other variables are tool
358 dependant. ie for testing a compiler, the value for
362 > might be set to a freshly built binary, as
363 opposed to one in the user's path.
</P
365 >Here's an example local site.exp file, as used for
374 >Example
3-
3. Local Config File
</B
383 CLASS=
"PROGRAMLISTING"
385 ## these variables are automatically generated by make ##
386 # Do not edit here. If you wish to override these values
387 # add them to the last section
388 set rootme
"/build/devo-builds/i586-pc-linux-gnulibc1/gcc"
389 set host_triplet i586-pc-linux-gnulibc1
390 set build_triplet i586-pc-linux-gnulibc1
391 set target_triplet i586-pc-linux-gnulibc1
392 set target_alias i586-pc-linux-gnulibc1
394 set CXXFLAGS
"-I/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libio -I$srcdir/../libg++/src -I$srcdir/../libio -I$srcdir/../libstdc++ -I$srcdir/../libstdc++/stl -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libg++ -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libstdc++"
395 append LDFLAGS
" -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../ld"
396 set tmpdir /build/devo-builds/i586-pc-linux-gnulibc1/gcc/testsuite
397 set srcdir
"${srcdir}/testsuite"
398 ## All variables above are generated by configure. Do Not Edit ##
406 >This file defines the required fields for a local config
407 file, namely the three config triplets, and the srcdir. It also
408 defines several other Tcl variables that are used exclusivly by
409 the GCC test suite. For most test cases, the CXXFLAGS and LDFLAGS
410 are supplied by DejaGnu itself for cross testing, but to test a
411 compiler, GCC needs to manipulate these itself.
</P
429 HREF=
"outputfiles.html"
454 >The files DejaGnu produces.
</TD
464 >Global Config File
</TD