OSDN Git Service

7428505859569ac5c2177862b585598b8f22a48f
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / README.gcc
1 This file contains a list of notes for those writing testcases and those
2 writing expect scripts.  At present, they're in random order.
3 \f
4 Verbosity Levels
5
6 - each level adds verbosity so level 2 prints all level 1 and level 2 stuff.
7
8 1) Print a one-liner indicating the testcase being run (and maybe special
9    compiler options).
10
11 2) Print compiler and program invocation including arguments and their output.
12    Proc's gcc_load and gcc_start handle the latter two.
13
14 3) Print detailed testcase analysis like "Looking for pattern ...", etc.
15
16 4) Maximum verbosity.  Print anything else of interest.
17 \f
18 send_log conventions
19
20 Various messages are stored in gcc.log by the testing framework and we
21 try to augment them with some of our own.  The format of the framework
22 messages are:
23
24 PASS: blah blah ...
25 FAIL: blah blah ...
26
27 so we use
28
29 XXXX: blah blah ...
30
31 Current messages are:
32
33 EXEC: program being executed (so compiler path and args are recorded)
34 STAT: intermediate pass/fail statistics
35 \f
36 DO NOT PUT NON-PORTABLE TESTCASES IN gcc.c-torture.
37
38 ANY TARGET SPECIFIC TESTCASE MUST HAVE APPROPRIATE CODE TO PREVENT IT FROM
39 CAUSING A `FAILURE' ON UNSUPPORTED PLATFORMS.
40 \f
41 Test scripts must ignore the compiler messages "path prefix never used"
42 and "linker input file unused".  Don't let their appearance cause a testcase
43 to fail.  See lib/dg.exp for the exact regsub to use.
44 \f
45 If you're unclear about which directory a testcase should be installed in,
46 ask gcc-local.
47 \f
48 Always use abort() for runtime failures, and exit(0) for success.
49 The testing harness is set up to watch for these and do something appropriate
50 (when necessary) for target boards.
51 \f
52 Have the text of a fail message be the same as that for pass.
53 IE: have
54
55         if ...success...
56                 pass "pr 1234"
57         else
58                 fail "pr 1234"
59
60 not
61
62         if ...success...
63                 pass "pr 1234 passed"
64         else
65                 fail "pr 1234 failed"
66
67
68 This lets test-tool (which drives the nightly tests) do a better job
69 at tracking which tests have digressed or been fixed.
70 \f
71 Add more notes here.