1<html lang="en">
2<head>
3<title>Installing GCC: Testing</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Installing GCC: Testing">
6<meta name="generator" content="makeinfo 4.7">
7<link title="Top" rel="top" href="#Top">
8<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9<!--
10Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
111999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
12
13   Permission is granted to copy, distribute and/or modify this document
14under the terms of the GNU Free Documentation License, Version 1.2 or
15any later version published by the Free Software Foundation; with no
16Invariant Sections, the Front-Cover texts being (a) (see below), and
17with the Back-Cover Texts being (b) (see below).  A copy of the
18license is included in the section entitled "GNU Free Documentation License".
19
20(a) The FSF's Front-Cover Text is:
21
22     A GNU Manual
23
24(b) The FSF's Back-Cover Text is:
25
26     You have freedom to copy and modify this GNU Manual, like GNU
27     software.  Copies published by the Free Software Foundation raise
28     funds for GNU development.-->
29<meta http-equiv="Content-Style-Type" content="text/css">
30<style type="text/css"><!--
31  pre.display { font-family:inherit }
32  pre.format  { font-family:inherit }
33  pre.smalldisplay { font-family:inherit; font-size:smaller }
34  pre.smallformat  { font-family:inherit; font-size:smaller }
35  pre.smallexample { font-size:smaller }
36  pre.smalllisp    { font-size:smaller }
37  span.sc { font-variant:small-caps }
38  span.roman { font-family: serif; font-weight: normal; } 
39--></style>
40</head>
41<body>
42<h1 class="settitle">Installing GCC: Testing</h1>
43<a name="index-Testing-1"></a><a name="index-Installing-GCC_003a-Testing-2"></a><a name="index-Testsuite-3"></a>
44Before you install GCC, we encourage you to run the testsuites and to
45compare your results with results from a similar configuration that have
46been submitted to the
47<a href="http://gcc.gnu.org/ml/gcc-testresults/">gcc-testresults mailing list</a>. 
48Some of these archived results are linked from the build status lists
49at <a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>, although not everyone who
50reports a successful build runs the testsuites and submits the results. 
51This step is optional and may require you to download additional software,
52but it can give you confidence in your new GCC installation or point out
53problems before you install and start using your new GCC.
54
55   <p>First, you must have <a href="download.html">downloaded the testsuites</a>. 
56These are part of the full distribution, but if you downloaded the
57&ldquo;core&rdquo; compiler plus any front ends, you must download the testsuites
58separately.
59
60   <p>Second, you must have the testing tools installed.  This includes
61<a href="http://www.gnu.org/software/dejagnu/">DejaGnu</a> 1.4.1 or 1.4.3
62and later, Tcl, and Expect; the DejaGnu site has links to these.
63
64   <p>If the directories where <span class="command">runtest</span> and <span class="command">expect</span> were
65installed are not in the <span class="env">PATH</span>, you may need to set the following
66environment variables appropriately, as in the following example (which
67assumes that DejaGnu has been installed under <span class="file">/usr/local</span>):
68
69<pre class="example">          TCL_LIBRARY = /usr/local/share/tcl8.0
70          DEJAGNULIBS = /usr/local/share/dejagnu
71</pre>
72   <p>(On systems such as Cygwin, these paths are required to be actual
73paths, not mounts or links; presumably this is due to some lack of
74portability in the DejaGnu code.)
75
76   <p>Finally, you can run the testsuite (which may take a long time):
77<pre class="example">          cd <var>objdir</var>; make -k check
78</pre>
79   <p>This will test various components of GCC, such as compiler
80front ends and runtime libraries.  While running the testsuite, DejaGnu
81might emit some harmless messages resembling
82<span class="samp">WARNING: Couldn't find the global config file.</span> or
83<span class="samp">WARNING: Couldn't find tool init file</span> that can be ignored.
84
85<h3 class="section"><a name="TOC0"></a>0.1 How can I run the test suite on selected tests?</h3>
86
87<p>In order to run sets of tests selectively, there are targets
88<span class="samp">make check-gcc</span> and <span class="samp">make check-g++</span>
89in the <span class="file">gcc</span> subdirectory of the object directory.  You can also
90just run <span class="samp">make check</span> in a subdirectory of the object directory.
91
92   <p>A more selective way to just run all <span class="command">gcc</span> execute tests in the
93testsuite is to use
94
95<pre class="example">         make check-gcc RUNTESTFLAGS="execute.exp <var>other-options</var>"
96</pre>
97   <p>Likewise, in order to run only the <span class="command">g++</span> &ldquo;old-deja&rdquo; tests in
98the testsuite with filenames matching <span class="samp">9805*</span>, you would use
99
100<pre class="example">         make check-g++ RUNTESTFLAGS="old-deja.exp=9805* <var>other-options</var>"
101</pre>
102   <p>The <span class="file">*.exp</span> files are located in the testsuite directories of the GCC
103source, the most important ones being <span class="file">compile.exp</span>,
104<span class="file">execute.exp</span>, <span class="file">dg.exp</span> and <span class="file">old-deja.exp</span>. 
105To get a list of the possible <span class="file">*.exp</span> files, pipe the
106output of <span class="samp">make check</span> into a file and look at the
107<span class="samp">Running ...  .exp</span> lines.
108
109   <p>The Java runtime tests can be executed via <span class="samp">make check</span>
110in the <var>target</var><span class="file">/libjava/testsuite</span> directory in
111the build tree.
112
113<h3 class="section"><a name="TOC1"></a>0.2 Additional testing for Java Class Libraries</h3>
114
115<p>The <a href="http://sources.redhat.com/mauve/">Mauve Project</a> provides
116a suite of tests for the Java Class Libraries.  This suite can be run
117as part of libgcj testing by placing the Mauve tree within the libjava
118testsuite at <span class="file">libjava/testsuite/libjava.mauve/mauve</span>, or by
119specifying the location of that tree when invoking <span class="samp">make</span>, as in
120<span class="samp">make MAUVEDIR=~/mauve check</span>.
121
122   <p><a href="http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html">Jacks</a>
123is a free test suite that tests Java compiler front ends.  This suite
124can be run as part of libgcj testing by placing the Jacks tree within
125the libjava testsuite at <span class="file">libjava/testsuite/libjava.jacks/jacks</span>.
126
127<h3 class="section"><a name="TOC2"></a>0.3 How to interpret test results</h3>
128
129<p>The result of running the testsuite are various <span class="file">*.sum</span> and <span class="file">*.log</span>
130files in the testsuite subdirectories.  The <span class="file">*.log</span> files contain a
131detailed log of the compiler invocations and the corresponding
132results, the <span class="file">*.sum</span> files summarize the results.  These summaries
133contain status codes for all tests:
134
135     <ul>
136<li>PASS: the test passed as expected
137<li>XPASS: the test unexpectedly passed
138<li>FAIL: the test unexpectedly failed
139<li>XFAIL: the test failed as expected
140<li>UNSUPPORTED: the test is not supported on this platform
141<li>ERROR: the testsuite detected an error
142<li>WARNING: the testsuite detected a possible problem
143</ul>
144
145   <p>It is normal for some tests to report unexpected failures.  At the
146current time our testing harness does not allow fine grained control
147over whether or not a test is expected to fail.  We expect to fix this
148problem in future releases.
149
150<h3 class="section"><a name="TOC3"></a>0.4 Submitting test results</h3>
151
152<p>If you want to report the results to the GCC project, use the
153<span class="file">contrib/test_summary</span> shell script.  Start it in the <var>objdir</var> with
154
155<pre class="example">         <var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
156             -m gcc-testresults@gcc.gnu.org |sh
157</pre>
158   <p>This script uses the <span class="command">Mail</span> program to send the results, so
159make sure it is in your <span class="env">PATH</span>.  The file <span class="file">your_commentary.txt</span> is
160prepended to the testsuite summary and should contain any special
161remarks you have on your results or your build environment.  Please
162do not edit the testsuite result block or the subject line, as these
163messages may be automatically processed.
164
165   <p><hr />
166<p><a href="./index.html">Return to the GCC Installation page</a>
167
168<!-- ***Final install*********************************************************** -->
169<!-- ***Binaries**************************************************************** -->
170<!-- ***Specific**************************************************************** -->
171<!-- ***Old documentation****************************************************** -->
172<!-- ***GFDL******************************************************************** -->
173<!-- *************************************************************************** -->
174<!-- Part 6 The End of the Document -->
175</body></html>
176
177