4 >The files DejaGnu produces.
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.44"><LINK
10 HREF=
"book1.html"><LINK
13 HREF=
"runningtests.html"><LINK
16 HREF=
"runtest.html"><LINK
18 TITLE=
"Customizing DejaGnu"
19 HREF=
"customizing.html"></HEAD
32 >DejaGnu: The GNU Testing Framework
</TH
47 >Chapter
2. Running Tests
</TD
53 HREF=
"customizing.html"
67 >The files DejaGnu produces.
</A
70 >DejaGnu always writes two kinds of output files: summary
71 logs and detailed logs. The contents of both of these are
72 determined by your tests.
</P
74 >For troubleshooting, a third kind of output file is useful:
78 > to request an output file showing
93 >DejaGnu always produces a summary output file
97 >. This summary shows the names of
98 all test files run; for each test file, one line of output from
102 > command (showing status
121 trailing summary statistics that count passing and failing tests
122 (expected and unexpected); and the full pathname and version
123 number of the tool tested. (All possible outcomes, and all
124 errors, are always reflected in the summary output file,
125 regardless of whether or not you specify
131 >If any of your tests use the procedures
142 >, the summary output also
143 tabulates the corresponding outcomes.
</P
145 >For example, after
<B
149 >, look for a summary log in
153 >. Normally, DejaGnu writes this
154 file in your current working directory; use the
158 > option to select a different
164 >Example
2-
1. Here is a short sample summary log
</B
174 > Test Run By rob on Mon May
25 21:
40:
57 PDT
1992
176 Running ./gdb.t00/echo.exp ...
178 Running ./gdb.all/help.exp ...
179 PASS: help add-symbol-file
181 PASS: help breakpoint
"bre" abbreviation
182 FAIL: help run
"r" abbreviation
183 Running ./gdb.t10/crossload.exp ...
184 PASS: m68k-elf (elf-big) explicit format; loaded
185 XFAIL: mips-ecoff (ecoff-bigmips)
"ptype v_signed_char" signed C types
187 # of expected passes
5
188 # of expected failures
1
189 # of unexpected failures
1
190 /usr/latest/bin/gdb version
4.6.5 -q
206 >DejaGnu also saves a detailed log file
210 >, showing any output generated by
211 tests as well as the summary output. For example, after
214 >runtest --tool binutils
</B
215 >, look for a detailed
220 writes this file in your current working directory; use the
224 > option to select a different
230 >Example
2-
2. Here is a brief example showing a detailed log for
244 > Test Run By rob on Mon May
25 21:
40:
43 PDT
1992
248 --- Running ./g++.other/t01-
1.exp ---
251 --- Running ./g++.other/t01-
2.exp ---
253 p0000646.C: In function `int warn_return_1 ()':
254 p0000646.C:
109: warning: control reaches end of non-void function
255 p0000646.C: In function `int warn_return_arg (int)':
256 p0000646.C:
117: warning: control reaches end of non-void function
257 p0000646.C: In function `int warn_return_sum (int, int)':
258 p0000646.C:
125: warning: control reaches end of non-void function
259 p0000646.C: In function `struct foo warn_return_foo ()':
260 p0000646.C:
132: warning: control reaches end of non-void function
262 --- Running ./g++.other/t01-
4.exp ---
264 900403_04.C:
8: zero width for bit-field `foo'
265 --- Running ./g++.other/t01-
3.exp ---
266 FAIL: segment violation
267 900519_12.C:
9: parse error before `;'
268 900519_12.C:
12: Segmentation violation
269 /usr/latest/bin/gcc: Internal compiler error: program cc1plus got fatal signal
273 # of expected passes
1
274 # of expected failures
3
275 /usr/latest/bin/g++ version cygnus-
2.0.1
294 > option, you can request
295 a log file showing the output from
299 > itself, running in debugging
307 >) shows each pattern
311 > considers in analyzing test
314 >This file reflects each
<B
318 showing the string sent as input to the tool under test; and
322 > command, showing each
323 pattern it compares with the tool output.
</P
328 >Example
2-
3. The log messages begin with a message of the form
</B
338 > expect: does {
<SPAN
356 >For every unsuccessful match,
364 > after this message; if other patterns
365 are specified for the same
<SPAN
369 command, they are reflected also, but without the first part of
372 >expect... match pattern
</I
379 log for the successful match ends with
<I
383 followed by a record of the
<SPAN
387 variables set to describe a successful match.
</P
392 >Example
2-
4. Here is an excerpt from the debugging log for a
406 > send: sent {break gdbme.c:
34\n} to spawn id
6
407 expect: does {} (spawn_id
6) match pattern {Breakpoint.*at.* file
408 gdbme.c, line
34.*\(gdb\) $}? no
410 expect: does {} (spawn_id
0) match pattern {return} ? no
419 Breakpoint
8 at
0x23d8: file gdbme.c, line
34.
420 (gdb) expect: does {break gdbme.c:
34\r\nBreakpoint
8 at
0x23d8:
421 file gdbme.c, line
34.\r\n(gdb) } (spawn_id
6) match pattern
422 {Breakpoint.*at.* file gdbme.c, line
34.*\(gdb\) $}? yes
423 expect: set expect_out(
0,start) {
18}
424 expect: set expect_out(
0,end) {
71}
425 expect: set expect_out(
0,string) {Breakpoint
8 at
0x23d8: file
426 gdbme.c, line
34.\r\n(gdb) }
427 epect: set expect_out(spawn_id) {
6}
428 expect: set expect_out(buffer) {break gdbme.c:
34\r\nBreakpoint
8
429 at
0x23d8: file gdbme.c, line
34.\r\n(gdb) }
430 PASS:
70 0 breakpoint line number in file
437 >This example exhibits three properties of
445 > that might be surprising at
451 STYLE=
"list-style-type: disc"
453 >Empty output for the first attempted match. The
454 first set of attempted matches shown ran against the output
463 attempting to match the patterns supplied immediately; often,
464 the first pass is against incomplete output (or completely
465 before all output, as in this case).
</P
468 STYLE=
"list-style-type: disc"
470 >Interspersed tool output. The beginning of
471 the log entry for the second attempted match may be hard to
472 spot: this is because the prompt
<I
476 appears on the same line, just before the
480 > that marks the beginning of the
484 STYLE=
"list-style-type: disc"
486 >Fail-safe patterns. Many of the patterns
487 tested are fail-safe patterns provided by
491 > testing utilities, to reduce
492 possible indeterminacy. It is useful to anticipate potential
493 variations caused by extreme system conditions
497 > might issue the message
500 >virtual memory exhausted
</I
502 circumstances), or by changes in the tested program
505 >Undefined command
</I
507 outcome if the name of a tested command changes).
</P
513 particularly interesting fail-safe to notice; it checks for an
517 > prompt. This may happen,
518 for example, if the tested tool can filter output through a
521 >These fail-safe patterns (like the debugging log itself)
522 are primarily useful while developing test scripts. Use the
526 > procedure to make the actions for
527 fail-safe patterns produce messages starting with
531 > on standard output, and in the
532 detailed log file.
</P
568 HREF=
"customizing.html"
583 HREF=
"runningtests.html"
590 >Customizing DejaGnu
</TD