~ubuntu-branches/ubuntu/feisty/dejagnu/feisty

« back to all changes in this revision

Viewing changes to doc/html/x755.html

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2006-12-11 09:06:59 UTC
  • mfrom: (2.1.6 edgy)
  • Revision ID: james.westby@ubuntu.com-20061211090659-w586kgi3giz84053
Tags: 1.4.4.cvs20060709-3
* Acknowledge previous NMUs.
* Fix permissions on /usr/share/dejagnu when building without fakeroot
  (Closes: #392589, #379809).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2
 
<HTML
3
 
><HEAD
4
 
><TITLE
5
 
>The files DejaGnu produces.</TITLE
6
 
><META
7
 
NAME="GENERATOR"
8
 
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
9
 
"><LINK
10
 
REL="HOME"
11
 
TITLE="DejaGnu"
12
 
HREF="book1.html"><LINK
13
 
REL="UP"
14
 
TITLE="Running Tests"
15
 
HREF="c401.html"><LINK
16
 
REL="PREVIOUS"
17
 
TITLE="Runtest"
18
 
HREF="x428.html"><LINK
19
 
REL="NEXT"
20
 
TITLE="Customizing DejaGnu"
21
 
HREF="c848.html"></HEAD
22
 
><BODY
23
 
CLASS="SECT1"
24
 
BGCOLOR="#FFFFFF"
25
 
TEXT="#000000"
26
 
LINK="#0000FF"
27
 
VLINK="#840084"
28
 
ALINK="#0000FF"
29
 
><DIV
30
 
CLASS="NAVHEADER"
31
 
><TABLE
32
 
SUMMARY="Header navigation table"
33
 
WIDTH="100%"
34
 
BORDER="0"
35
 
CELLPADDING="0"
36
 
CELLSPACING="0"
37
 
><TR
38
 
><TH
39
 
COLSPAN="3"
40
 
ALIGN="center"
41
 
>DejaGnu: The GNU Testing Framework</TH
42
 
></TR
43
 
><TR
44
 
><TD
45
 
WIDTH="10%"
46
 
ALIGN="left"
47
 
VALIGN="bottom"
48
 
><A
49
 
HREF="x428.html"
50
 
ACCESSKEY="P"
51
 
>&#60;&#60;&#60; Previous</A
52
 
></TD
53
 
><TD
54
 
WIDTH="80%"
55
 
ALIGN="center"
56
 
VALIGN="bottom"
57
 
>Running Tests</TD
58
 
><TD
59
 
WIDTH="10%"
60
 
ALIGN="right"
61
 
VALIGN="bottom"
62
 
><A
63
 
HREF="c848.html"
64
 
ACCESSKEY="N"
65
 
>Next &#62;&#62;&#62;</A
66
 
></TD
67
 
></TR
68
 
></TABLE
69
 
><HR
70
 
ALIGN="LEFT"
71
 
WIDTH="100%"></DIV
72
 
><DIV
73
 
CLASS="SECT1"
74
 
><H1
75
 
CLASS="SECT1"
76
 
><A
77
 
NAME="OUTPUTFILES"
78
 
></A
79
 
>The files DejaGnu produces.</H1
80
 
><P
81
 
>DejaGnu always writes two kinds of output files: summary
82
 
    logs and detailed logs.  The contents of both of these are
83
 
    determined by your tests.</P
84
 
><P
85
 
>For troubleshooting, a third kind of output file is useful:
86
 
    use <TT
87
 
CLASS="OPTION"
88
 
>--debug</TT
89
 
> to request an output file showing
90
 
    details of what <SPAN
91
 
CLASS="PRODUCTNAME"
92
 
>Expect</SPAN
93
 
> is doing
94
 
    internally.</P
95
 
><DIV
96
 
CLASS="SECT2"
97
 
><H2
98
 
CLASS="SECT2"
99
 
><A
100
 
NAME="SUM"
101
 
></A
102
 
>Summary File</H2
103
 
><P
104
 
>DejaGnu always produces a summary output file
105
 
      <TT
106
 
CLASS="FILENAME"
107
 
>tool.sum</TT
108
 
>. This summary shows the names of
109
 
      all test files run; for each test file, one line of output from
110
 
      each <B
111
 
CLASS="COMMAND"
112
 
>pass</B
113
 
> command (showing status
114
 
      <I
115
 
CLASS="EMPHASIS"
116
 
>PASS</I
117
 
> or <I
118
 
CLASS="EMPHASIS"
119
 
>XPASS</I
120
 
>) or
121
 
      <B
122
 
CLASS="COMMAND"
123
 
>fail</B
124
 
> command (status
125
 
      <I
126
 
CLASS="EMPHASIS"
127
 
>FAIL</I
128
 
> or <I
129
 
CLASS="EMPHASIS"
130
 
>XFAIL</I
131
 
>);
132
 
      trailing summary statistics that count passing and failing tests
133
 
      (expected and unexpected); and the full pathname and version
134
 
      number of the tool tested.  (All possible outcomes, and all
135
 
      errors, are always reflected in the summary output file,
136
 
      regardless of whether or not you specify
137
 
      <TT
138
 
CLASS="OPTION"
139
 
>--all</TT
140
 
>.)</P
141
 
><P
142
 
>If any of your tests use the procedures
143
 
      <B
144
 
CLASS="COMMAND"
145
 
>unresolved</B
146
 
>, <B
147
 
CLASS="COMMAND"
148
 
>unsupported</B
149
 
>,
150
 
      or <B
151
 
CLASS="COMMAND"
152
 
>runtested</B
153
 
>, the summary output also
154
 
      tabulates the corresponding outcomes.</P
155
 
><P
156
 
>For example, after <B
157
 
CLASS="COMMAND"
158
 
>runtest --tool
159
 
      binutils</B
160
 
>, look for a summary log in
161
 
      <TT
162
 
CLASS="FILENAME"
163
 
>binutils.sum</TT
164
 
>. Normally, DejaGnu writes this
165
 
      file in your current working directory; use the
166
 
      <TT
167
 
CLASS="OPTION"
168
 
>--outdir</TT
169
 
> option to select a different
170
 
      directory.</P
171
 
><DIV
172
 
CLASS="EXAMPLE"
173
 
><A
174
 
NAME="AEN780"
175
 
></A
176
 
><P
177
 
><B
178
 
>Example 1. Here is a short sample summary log</B
179
 
></P
180
 
><TABLE
181
 
BORDER="0"
182
 
BGCOLOR="#E0E0E0"
183
 
WIDTH="100%"
184
 
><TR
185
 
><TD
186
 
><PRE
187
 
CLASS="SCREEN"
188
 
>       Test Run By rob on Mon May 25 21:40:57 PDT 1992
189
 
                 === gdb tests ===
190
 
        Running ./gdb.t00/echo.exp ...
191
 
        PASS:   Echo test
192
 
        Running ./gdb.all/help.exp ...
193
 
        PASS:   help add-symbol-file
194
 
        PASS:   help aliases
195
 
        PASS:   help breakpoint "bre" abbreviation
196
 
        FAIL:   help run "r" abbreviation
197
 
        Running ./gdb.t10/crossload.exp ...
198
 
        PASS:   m68k-elf (elf-big) explicit format; loaded
199
 
        XFAIL:  mips-ecoff (ecoff-bigmips) "ptype v_signed_char" signed C types
200
 
                === gdb Summary ===
201
 
        # of expected passes 5
202
 
        # of expected failures 1
203
 
        # of unexpected failures 1
204
 
        /usr/latest/bin/gdb version 4.6.5 -q
205
 
      </PRE
206
 
></TD
207
 
></TR
208
 
></TABLE
209
 
></DIV
210
 
></DIV
211
 
><DIV
212
 
CLASS="SECT2"
213
 
><H2
214
 
CLASS="SECT2"
215
 
><A
216
 
NAME="LOG"
217
 
></A
218
 
>Log File</H2
219
 
><P
220
 
>DejaGnu also saves a detailed log file
221
 
      <TT
222
 
CLASS="FILENAME"
223
 
>tool.log</TT
224
 
>, showing any output generated by
225
 
      tests as well as the summary output. For example, after
226
 
      <B
227
 
CLASS="COMMAND"
228
 
>runtest --tool binutils</B
229
 
>, look for a detailed
230
 
      log in <TT
231
 
CLASS="FILENAME"
232
 
>binutils.log</TT
233
 
>. Normally, DejaGnu
234
 
      writes this file in your current working directory; use the
235
 
      <TT
236
 
CLASS="OPTION"
237
 
>--outdir</TT
238
 
> option to select a different
239
 
      directory.</P
240
 
><DIV
241
 
CLASS="EXAMPLE"
242
 
><A
243
 
NAME="AEN790"
244
 
></A
245
 
><P
246
 
><B
247
 
>Example 2. Here is a brief example showing a detailed log for
248
 
        <SPAN
249
 
CLASS="PRODUCTNAME"
250
 
>G++</SPAN
251
 
> tests</B
252
 
></P
253
 
><TABLE
254
 
BORDER="0"
255
 
BGCOLOR="#E0E0E0"
256
 
WIDTH="100%"
257
 
><TR
258
 
><TD
259
 
><PRE
260
 
CLASS="SCREEN"
261
 
>       Test Run By rob on Mon May 25 21:40:43 PDT 1992
262
 
 
263
 
                === g++ tests ===
264
 
 
265
 
        --- Running ./g++.other/t01-1.exp ---
266
 
        PASS:   operate delete
267
 
 
268
 
        --- Running ./g++.other/t01-2.exp ---
269
 
        FAIL:   i960 bug EOF
270
 
        p0000646.C: In function `int  warn_return_1 ()':
271
 
        p0000646.C:109: warning: control reaches end of non-void function
272
 
        p0000646.C: In function `int  warn_return_arg (int)':
273
 
        p0000646.C:117: warning: control reaches end of non-void function
274
 
        p0000646.C: In function `int  warn_return_sum (int, int)':
275
 
        p0000646.C:125: warning: control reaches end of non-void function
276
 
        p0000646.C: In function `struct foo warn_return_foo ()':
277
 
        p0000646.C:132: warning: control reaches end of non-void function
278
 
 
279
 
        --- Running ./g++.other/t01-4.exp ---
280
 
        FAIL:   abort
281
 
        900403_04.C:8: zero width for bit-field `foo'
282
 
        --- Running ./g++.other/t01-3.exp ---
283
 
        FAIL:   segment violation
284
 
        900519_12.C:9: parse error before `;'
285
 
        900519_12.C:12: Segmentation violation
286
 
        /usr/latest/bin/gcc: Internal compiler error: program cc1plus got fatal signal
287
 
 
288
 
                === g++ Summary ===
289
 
 
290
 
        # of expected passes 1
291
 
        # of expected failures 3
292
 
        /usr/latest/bin/g++ version cygnus-2.0.1
293
 
        </PRE
294
 
></TD
295
 
></TR
296
 
></TABLE
297
 
></DIV
298
 
></DIV
299
 
><DIV
300
 
CLASS="SECT2"
301
 
><H2
302
 
CLASS="SECT2"
303
 
><A
304
 
NAME="DEBUGFILE"
305
 
></A
306
 
>Debug Log File</H2
307
 
><P
308
 
>With the <TT
309
 
CLASS="OPTION"
310
 
>--debug</TT
311
 
> option, you can request
312
 
      a log file showing the output from
313
 
      <SPAN
314
 
CLASS="PRODUCTNAME"
315
 
>Expect</SPAN
316
 
> itself, running in debugging
317
 
      mode. This file (<TT
318
 
CLASS="FILENAME"
319
 
>dbg.log</TT
320
 
>, in the directory
321
 
      where you start <B
322
 
CLASS="COMMAND"
323
 
>runtest</B
324
 
>) shows each pattern
325
 
      <SPAN
326
 
CLASS="PRODUCTNAME"
327
 
>Expect</SPAN
328
 
> considers in analyzing test
329
 
      output.</P
330
 
><P
331
 
>This file reflects each <B
332
 
CLASS="COMMAND"
333
 
>send</B
334
 
> command,
335
 
      showing the string sent as input to the tool under test; and
336
 
      each <SPAN
337
 
CLASS="PRODUCTNAME"
338
 
>Expect</SPAN
339
 
> command, showing each
340
 
      pattern it compares with the tool output.</P
341
 
><DIV
342
 
CLASS="EXAMPLE"
343
 
><A
344
 
NAME="AEN805"
345
 
></A
346
 
><P
347
 
><B
348
 
>Example 3. The log messages begin with a message of the form</B
349
 
></P
350
 
><TABLE
351
 
BORDER="0"
352
 
BGCOLOR="#E0E0E0"
353
 
WIDTH="100%"
354
 
><TR
355
 
><TD
356
 
><PRE
357
 
CLASS="SCREEN"
358
 
>&#13;  expect: does {<SPAN
359
 
CLASS="SYMBOL"
360
 
>tool output</SPAN
361
 
>} (spawn_id <SPAN
362
 
CLASS="SYMBOL"
363
 
>n</SPAN
364
 
>)
365
 
         match pattern {<I
366
 
CLASS="EMPHASIS"
367
 
>expected pattern</I
368
 
>}?
369
 
 
370
 
        </PRE
371
 
></TD
372
 
></TR
373
 
></TABLE
374
 
></DIV
375
 
><P
376
 
>For every unsuccessful match,
377
 
      <SPAN
378
 
CLASS="PRODUCTNAME"
379
 
>Expect</SPAN
380
 
> issues a
381
 
      <I
382
 
CLASS="EMPHASIS"
383
 
>no</I
384
 
> after this message; if other patterns
385
 
      are specified for the same <SPAN
386
 
CLASS="PRODUCTNAME"
387
 
>Expect</SPAN
388
 
>
389
 
      command, they are reflected also, but without the first part of
390
 
      the message (<I
391
 
CLASS="EMPHASIS"
392
 
>expect... match pattern</I
393
 
>).</P
394
 
><P
395
 
>When <SPAN
396
 
CLASS="PRODUCTNAME"
397
 
>Expect</SPAN
398
 
> finds a match, the
399
 
      log for the successful match ends with <I
400
 
CLASS="EMPHASIS"
401
 
>yes</I
402
 
>,
403
 
      followed by a record of the <SPAN
404
 
CLASS="PRODUCTNAME"
405
 
>Expect</SPAN
406
 
>
407
 
      variables set to describe a successful match.</P
408
 
><DIV
409
 
CLASS="EXAMPLE"
410
 
><A
411
 
NAME="AEN820"
412
 
></A
413
 
><P
414
 
><B
415
 
>Example 4. Here is an excerpt from the debugging log for a
416
 
        <SPAN
417
 
CLASS="PRODUCTNAME"
418
 
>GDB</SPAN
419
 
> test:</B
420
 
></P
421
 
><TABLE
422
 
BORDER="0"
423
 
BGCOLOR="#E0E0E0"
424
 
WIDTH="100%"
425
 
><TR
426
 
><TD
427
 
><PRE
428
 
CLASS="SCREEN"
429
 
>       send: sent {break gdbme.c:34\n} to spawn id 6
430
 
        expect: does {} (spawn_id 6) match pattern {Breakpoint.*at.* file
431
 
        gdbme.c, line 34.*\(gdb\) $}? no
432
 
        {.*\(gdb\) $}? no
433
 
        expect: does {} (spawn_id 0) match pattern {return} ? no
434
 
        {\(y or n\) }? no
435
 
        {buffer_full}? no
436
 
        {virtual}? no
437
 
        {memory}? no
438
 
        {exhausted}? no
439
 
        {Undefined}? no
440
 
        {command}? no
441
 
        break gdbme.c:34
442
 
        Breakpoint 8 at 0x23d8: file gdbme.c, line 34.
443
 
        (gdb) expect: does {break gdbme.c:34\r\nBreakpoint 8 at 0x23d8:
444
 
        file gdbme.c, line 34.\r\n(gdb) } (spawn_id 6) match pattern
445
 
        {Breakpoint.*at.* file gdbme.c, line 34.*\(gdb\) $}? yes
446
 
        expect: set expect_out(0,start) {18}
447
 
        expect: set expect_out(0,end) {71}
448
 
        expect: set expect_out(0,string) {Breakpoint 8 at 0x23d8: file
449
 
        gdbme.c, line 34.\r\n(gdb) }
450
 
        epect: set expect_out(spawn_id) {6}
451
 
        expect: set expect_out(buffer) {break gdbme.c:34\r\nBreakpoint 8
452
 
        at 0x23d8: file gdbme.c, line 34.\r\n(gdb) }
453
 
        PASS:   70      0       breakpoint line number in file
454
 
        </PRE
455
 
></TD
456
 
></TR
457
 
></TABLE
458
 
></DIV
459
 
><P
460
 
>This example exhibits three properties of
461
 
        <SPAN
462
 
CLASS="PRODUCTNAME"
463
 
>Expect</SPAN
464
 
> and
465
 
        <SPAN
466
 
CLASS="PRODUCTNAME"
467
 
>DejaGnu</SPAN
468
 
> that might be surprising at
469
 
        first glance:</P
470
 
><P
471
 
></P
472
 
><UL
473
 
><LI
474
 
STYLE="list-style-type: disc"
475
 
><P
476
 
>Empty output for the first attempted match.  The
477
 
        first set of attempted matches shown ran against the output
478
 
        <I
479
 
CLASS="EMPHASIS"
480
 
>{}</I
481
 
> --- that is, no
482
 
        output. <SPAN
483
 
CLASS="PRODUCTNAME"
484
 
>Expect</SPAN
485
 
> begins
486
 
        attempting to match the patterns supplied immediately; often,
487
 
        the first pass is against incomplete output (or completely
488
 
        before all output, as in this case).</P
489
 
></LI
490
 
><LI
491
 
STYLE="list-style-type: disc"
492
 
><P
493
 
>Interspersed tool output.  The beginning of
494
 
        the log entry for the second attempted match may be hard to
495
 
        spot: this is because the prompt <I
496
 
CLASS="EMPHASIS"
497
 
>{(gdb) }</I
498
 
>
499
 
        appears on the same line, just before the
500
 
        <I
501
 
CLASS="EMPHASIS"
502
 
>expect:</I
503
 
> that marks the beginning of the
504
 
        log entry.</P
505
 
></LI
506
 
><LI
507
 
STYLE="list-style-type: disc"
508
 
><P
509
 
>Fail-safe patterns.  Many of the patterns
510
 
        tested are fail-safe patterns provided by
511
 
        <SPAN
512
 
CLASS="PRODUCTNAME"
513
 
>GDB</SPAN
514
 
> testing utilities, to reduce
515
 
        possible indeterminacy.  It is useful to anticipate potential
516
 
        variations caused by extreme system conditions
517
 
        (<SPAN
518
 
CLASS="PRODUCTNAME"
519
 
>GDB</SPAN
520
 
> might issue the message
521
 
        <I
522
 
CLASS="EMPHASIS"
523
 
>virtual memory exhausted</I
524
 
> in rare
525
 
        circumstances), or by changes in the tested program
526
 
        (<I
527
 
CLASS="EMPHASIS"
528
 
>Undefined command</I
529
 
> is the likeliest
530
 
        outcome if the name of a tested command changes).</P
531
 
><P
532
 
>The pattern <I
533
 
CLASS="EMPHASIS"
534
 
>{return}</I
535
 
> is a
536
 
        particularly interesting fail-safe to notice; it checks for an
537
 
        unexpected <B
538
 
CLASS="KEYCAP"
539
 
>RET</B
540
 
> prompt.  This may happen,
541
 
        for example, if the tested tool can filter output through a
542
 
        pager.</P
543
 
><P
544
 
>These fail-safe patterns (like the debugging log itself)
545
 
        are primarily useful while developing test scripts.  Use the
546
 
        <B
547
 
CLASS="COMMAND"
548
 
>error</B
549
 
> procedure to make the actions for
550
 
        fail-safe patterns produce messages starting with
551
 
        <I
552
 
CLASS="EMPHASIS"
553
 
>ERROR</I
554
 
> on standard output, and in the
555
 
        detailed log file.</P
556
 
></LI
557
 
></UL
558
 
></DIV
559
 
></DIV
560
 
><DIV
561
 
CLASS="NAVFOOTER"
562
 
><HR
563
 
ALIGN="LEFT"
564
 
WIDTH="100%"><TABLE
565
 
SUMMARY="Footer navigation table"
566
 
WIDTH="100%"
567
 
BORDER="0"
568
 
CELLPADDING="0"
569
 
CELLSPACING="0"
570
 
><TR
571
 
><TD
572
 
WIDTH="33%"
573
 
ALIGN="left"
574
 
VALIGN="top"
575
 
><A
576
 
HREF="x428.html"
577
 
ACCESSKEY="P"
578
 
>&#60;&#60;&#60; Previous</A
579
 
></TD
580
 
><TD
581
 
WIDTH="34%"
582
 
ALIGN="center"
583
 
VALIGN="top"
584
 
><A
585
 
HREF="book1.html"
586
 
ACCESSKEY="H"
587
 
>Home</A
588
 
></TD
589
 
><TD
590
 
WIDTH="33%"
591
 
ALIGN="right"
592
 
VALIGN="top"
593
 
><A
594
 
HREF="c848.html"
595
 
ACCESSKEY="N"
596
 
>Next &#62;&#62;&#62;</A
597
 
></TD
598
 
></TR
599
 
><TR
600
 
><TD
601
 
WIDTH="33%"
602
 
ALIGN="left"
603
 
VALIGN="top"
604
 
>Runtest</TD
605
 
><TD
606
 
WIDTH="34%"
607
 
ALIGN="center"
608
 
VALIGN="top"
609
 
><A
610
 
HREF="c401.html"
611
 
ACCESSKEY="U"
612
 
>Up</A
613
 
></TD
614
 
><TD
615
 
WIDTH="33%"
616
 
ALIGN="right"
617
 
VALIGN="top"
618
 
>Customizing DejaGnu</TD
619
 
></TR
620
 
></TABLE
621
 
></DIV
622
 
></BODY
623
 
></HTML
624
 
>
 
 
b'\\ No newline at end of file'