test.html revision 1.10 1 1.10 mrg <html lang="en">
2 1.10 mrg <head>
3 1.10 mrg <title>Installing GCC: Testing</title>
4 1.10 mrg <meta http-equiv="Content-Type" content="text/html">
5 1.10 mrg <meta name="description" content="Installing GCC: Testing">
6 1.10 mrg <meta name="generator" content="makeinfo 4.13">
7 1.10 mrg <link title="Top" rel="top" href="#Top">
8 1.10 mrg <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9 1.10 mrg <!--
10 1.10 mrg Copyright (C) 1988-2017 Free Software Foundation, Inc.
11 1.1 mrg
12 1.10 mrg Permission is granted to copy, distribute and/or modify this document
13 1.3 mrg under the terms of the GNU Free Documentation License, Version 1.3 or
14 1.1 mrg any later version published by the Free Software Foundation; with no
15 1.1 mrg Invariant Sections, the Front-Cover texts being (a) (see below), and
16 1.1 mrg with the Back-Cover Texts being (b) (see below). A copy of the
17 1.10 mrg license is included in the section entitled "GNU Free Documentation License".
18 1.1 mrg
19 1.1 mrg (a) The FSF's Front-Cover Text is:
20 1.1 mrg
21 1.10 mrg A GNU Manual
22 1.1 mrg
23 1.1 mrg (b) The FSF's Back-Cover Text is:
24 1.1 mrg
25 1.10 mrg You have freedom to copy and modify this GNU Manual, like GNU
26 1.1 mrg software. Copies published by the Free Software Foundation raise
27 1.10 mrg funds for GNU development.-->
28 1.10 mrg <meta http-equiv="Content-Style-Type" content="text/css">
29 1.10 mrg <style type="text/css"><!--
30 1.10 mrg pre.display { font-family:inherit }
31 1.10 mrg pre.format { font-family:inherit }
32 1.10 mrg pre.smalldisplay { font-family:inherit; font-size:smaller }
33 1.10 mrg pre.smallformat { font-family:inherit; font-size:smaller }
34 1.10 mrg pre.smallexample { font-size:smaller }
35 1.10 mrg pre.smalllisp { font-size:smaller }
36 1.10 mrg span.sc { font-variant:small-caps }
37 1.10 mrg span.roman { font-family:serif; font-weight:normal; }
38 1.10 mrg span.sansserif { font-family:sans-serif; font-weight:normal; }
39 1.10 mrg --></style>
40 1.1 mrg </head>
41 1.10 mrg <body>
42 1.10 mrg <h1 class="settitle">Installing GCC: Testing</h1>
43 1.10 mrg <a name="index-Testing-1"></a><a name="index-Installing-GCC_003a-Testing-2"></a><a name="index-Testsuite-3"></a>
44 1.10 mrg Before you install GCC, we encourage you to run the testsuites and to
45 1.1 mrg compare your results with results from a similar configuration that have
46 1.1 mrg been submitted to the
47 1.10 mrg <a href="http://gcc.gnu.org/ml/gcc-testresults/">gcc-testresults mailing list</a>.
48 1.1 mrg Some of these archived results are linked from the build status lists
49 1.1 mrg at <a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>, although not everyone who
50 1.10 mrg reports a successful build runs the testsuites and submits the results.
51 1.1 mrg This step is optional and may require you to download additional software,
52 1.1 mrg but it can give you confidence in your new GCC installation or point out
53 1.1 mrg problems before you install and start using your new GCC.
54 1.10 mrg
55 1.10 mrg <p>First, you must have <a href="download.html">downloaded the testsuites</a>.
56 1.1 mrg These are part of the full distribution, but if you downloaded the
57 1.1 mrg “core” compiler plus any front ends, you must download the testsuites
58 1.1 mrg separately.
59 1.10 mrg
60 1.10 mrg <p>Second, you must have the testing tools installed. This includes
61 1.1 mrg <a href="http://www.gnu.org/software/dejagnu/">DejaGnu</a>, Tcl, and Expect;
62 1.10 mrg the DejaGnu site has links to these. For running the BRIG frontend
63 1.10 mrg tests, a tool to assemble the binary BRIGs from HSAIL text,
64 1.10 mrg <a href="https://github.com/HSAFoundation/HSAIL-Tools/">HSAILasm</a> must
65 1.10 mrg be installed.
66 1.10 mrg
67 1.10 mrg <p>If the directories where <samp><span class="command">runtest</span></samp> and <samp><span class="command">expect</span></samp> were
68 1.10 mrg installed are not in the <samp><span class="env">PATH</span></samp>, you may need to set the following
69 1.1 mrg environment variables appropriately, as in the following example (which
70 1.10 mrg assumes that DejaGnu has been installed under <samp><span class="file">/usr/local</span></samp>):
71 1.1 mrg
72 1.10 mrg <pre class="smallexample"> TCL_LIBRARY = /usr/local/share/tcl8.0
73 1.10 mrg DEJAGNULIBS = /usr/local/share/dejagnu
74 1.10 mrg </pre>
75 1.10 mrg <p>(On systems such as Cygwin, these paths are required to be actual
76 1.1 mrg paths, not mounts or links; presumably this is due to some lack of
77 1.1 mrg portability in the DejaGnu code.)
78 1.1 mrg
79 1.10 mrg <p>Finally, you can run the testsuite (which may take a long time):
80 1.10 mrg <pre class="smallexample"> cd <var>objdir</var>; make -k check
81 1.10 mrg </pre>
82 1.10 mrg <p>This will test various components of GCC, such as compiler
83 1.1 mrg front ends and runtime libraries. While running the testsuite, DejaGnu
84 1.1 mrg might emit some harmless messages resembling
85 1.10 mrg ‘<samp><span class="samp">WARNING: Couldn't find the global config file.</span></samp>’ or
86 1.10 mrg ‘<samp><span class="samp">WARNING: Couldn't find tool init file</span></samp>’ that can be ignored.
87 1.10 mrg
88 1.10 mrg <p>If you are testing a cross-compiler, you may want to run the testsuite
89 1.1 mrg on a simulator as described at <a href="http://gcc.gnu.org/simtest-howto.html">http://gcc.gnu.org/simtest-howto.html</a>.
90 1.10 mrg
91 1.10 mrg <h3 class="section"><a name="TOC0"></a>How can you run the testsuite on selected tests?</h3>
92 1.1 mrg
93 1.1 mrg <p>In order to run sets of tests selectively, there are targets
94 1.10 mrg ‘<samp><span class="samp">make check-gcc</span></samp>’ and language specific ‘<samp><span class="samp">make check-c</span></samp>’,
95 1.10 mrg ‘<samp><span class="samp">make check-c++</span></samp>’, ‘<samp><span class="samp">make check-fortran</span></samp>’,
96 1.10 mrg ‘<samp><span class="samp">make check-ada</span></samp>’, ‘<samp><span class="samp">make check-objc</span></samp>’, ‘<samp><span class="samp">make check-obj-c++</span></samp>’,
97 1.10 mrg ‘<samp><span class="samp">make check-lto</span></samp>’
98 1.10 mrg in the <samp><span class="file">gcc</span></samp> subdirectory of the object directory. You can also
99 1.10 mrg just run ‘<samp><span class="samp">make check</span></samp>’ in a subdirectory of the object directory.
100 1.1 mrg
101 1.10 mrg <p>A more selective way to just run all <samp><span class="command">gcc</span></samp> execute tests in the
102 1.1 mrg testsuite is to use
103 1.10 mrg
104 1.10 mrg <pre class="smallexample"> make check-gcc RUNTESTFLAGS="execute.exp <var>other-options</var>"
105 1.10 mrg </pre>
106 1.10 mrg <p>Likewise, in order to run only the <samp><span class="command">g++</span></samp> “old-deja” tests in
107 1.10 mrg the testsuite with filenames matching ‘<samp><span class="samp">9805*</span></samp>’, you would use
108 1.10 mrg
109 1.10 mrg <pre class="smallexample"> make check-g++ RUNTESTFLAGS="old-deja.exp=9805* <var>other-options</var>"
110 1.10 mrg </pre>
111 1.10 mrg <p>The <samp><span class="file">*.exp</span></samp> files are located in the testsuite directories of the GCC
112 1.10 mrg source, the most important ones being <samp><span class="file">compile.exp</span></samp>,
113 1.10 mrg <samp><span class="file">execute.exp</span></samp>, <samp><span class="file">dg.exp</span></samp> and <samp><span class="file">old-deja.exp</span></samp>.
114 1.10 mrg To get a list of the possible <samp><span class="file">*.exp</span></samp> files, pipe the
115 1.10 mrg output of ‘<samp><span class="samp">make check</span></samp>’ into a file and look at the
116 1.10 mrg ‘<samp><span class="samp">Running ... .exp</span></samp>’ lines.
117 1.10 mrg
118 1.10 mrg <h3 class="section"><a name="TOC1"></a>Passing options and running multiple testsuites</h3>
119 1.1 mrg
120 1.1 mrg <p>You can pass multiple options to the testsuite using the
121 1.10 mrg ‘<samp><span class="samp">--target_board</span></samp>’ option of DejaGNU, either passed as part of
122 1.10 mrg ‘<samp><span class="samp">RUNTESTFLAGS</span></samp>’, or directly to <samp><span class="command">runtest</span></samp> if you prefer to
123 1.1 mrg work outside the makefiles. For example,
124 1.1 mrg
125 1.10 mrg <pre class="smallexample"> make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
126 1.10 mrg </pre>
127 1.10 mrg <p>will run the standard <samp><span class="command">g++</span></samp> testsuites (“unix” is the target name
128 1.1 mrg for a standard native testsuite situation), passing
129 1.10 mrg ‘<samp><span class="samp">-O3 -fmerge-constants</span></samp>’ to the compiler on every test, i.e.,
130 1.1 mrg slashes separate options.
131 1.10 mrg
132 1.10 mrg <p>You can run the testsuites multiple times using combinations of options
133 1.1 mrg with a syntax similar to the brace expansion of popular shells:
134 1.1 mrg
135 1.10 mrg <pre class="smallexample"> ..."--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}"
136 1.10 mrg </pre>
137 1.10 mrg <p>(Note the empty option caused by the trailing comma in the final group.)
138 1.10 mrg The following will run each testsuite eight times using the ‘<samp><span class="samp">arm-sim</span></samp>’
139 1.1 mrg target, as if you had specified all possible combinations yourself:
140 1.1 mrg
141 1.10 mrg <pre class="smallexample"> --target_board='arm-sim/-mhard-float/-O1 \
142 1.10 mrg arm-sim/-mhard-float/-O2 \
143 1.10 mrg arm-sim/-mhard-float/-O3 \
144 1.10 mrg arm-sim/-mhard-float \
145 1.10 mrg arm-sim/-msoft-float/-O1 \
146 1.10 mrg arm-sim/-msoft-float/-O2 \
147 1.10 mrg arm-sim/-msoft-float/-O3 \
148 1.10 mrg arm-sim/-msoft-float'
149 1.10 mrg </pre>
150 1.10 mrg <p>They can be combined as many times as you wish, in arbitrary ways. This
151 1.1 mrg list:
152 1.10 mrg
153 1.10 mrg <pre class="smallexample"> ..."--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}"
154 1.10 mrg </pre>
155 1.10 mrg <p>will generate four combinations, all involving ‘<samp><span class="samp">-Wextra</span></samp>’.
156 1.10 mrg
157 1.10 mrg <p>The disadvantage to this method is that the testsuites are run in serial,
158 1.1 mrg which is a waste on multiprocessor systems. For users with GNU Make and
159 1.1 mrg a shell which performs brace expansion, you can run the testsuites in
160 1.10 mrg parallel by having the shell perform the combinations and <samp><span class="command">make</span></samp>
161 1.10 mrg do the parallel runs. Instead of using ‘<samp><span class="samp">--target_board</span></samp>’, use a
162 1.1 mrg special makefile target:
163 1.1 mrg
164 1.10 mrg <pre class="smallexample"> make -j<var>N</var> check-<var>testsuite</var>//<var>test-target</var>/<var>option1</var>/<var>option2</var>/...
165 1.10 mrg </pre>
166 1.10 mrg <p>For example,
167 1.10 mrg
168 1.10 mrg <pre class="smallexample"> make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
169 1.10 mrg </pre>
170 1.10 mrg <p>will run three concurrent “make-gcc” testsuites, eventually testing all
171 1.1 mrg ten combinations as described above. Note that this is currently only
172 1.10 mrg supported in the <samp><span class="file">gcc</span></samp> subdirectory. (To see how this works, try
173 1.10 mrg typing <samp><span class="command">echo</span></samp> before the example given here.)
174 1.10 mrg
175 1.10 mrg <h3 class="section"><a name="TOC2"></a>How to interpret test results</h3>
176 1.1 mrg
177 1.10 mrg <p>The result of running the testsuite are various <samp><span class="file">*.sum</span></samp> and <samp><span class="file">*.log</span></samp>
178 1.10 mrg files in the testsuite subdirectories. The <samp><span class="file">*.log</span></samp> files contain a
179 1.1 mrg detailed log of the compiler invocations and the corresponding
180 1.10 mrg results, the <samp><span class="file">*.sum</span></samp> files summarize the results. These summaries
181 1.1 mrg contain status codes for all tests:
182 1.1 mrg
183 1.10 mrg <ul>
184 1.10 mrg <li>PASS: the test passed as expected
185 1.10 mrg <li>XPASS: the test unexpectedly passed
186 1.10 mrg <li>FAIL: the test unexpectedly failed
187 1.10 mrg <li>XFAIL: the test failed as expected
188 1.10 mrg <li>UNSUPPORTED: the test is not supported on this platform
189 1.10 mrg <li>ERROR: the testsuite detected an error
190 1.10 mrg <li>WARNING: the testsuite detected a possible problem
191 1.10 mrg </ul>
192 1.10 mrg
193 1.10 mrg <p>It is normal for some tests to report unexpected failures. At the
194 1.1 mrg current time the testing harness does not allow fine grained control
195 1.1 mrg over whether or not a test is expected to fail. This problem should
196 1.1 mrg be fixed in future releases.
197 1.1 mrg
198 1.10 mrg <h3 class="section"><a name="TOC3"></a>Submitting test results</h3>
199 1.1 mrg
200 1.1 mrg <p>If you want to report the results to the GCC project, use the
201 1.10 mrg <samp><span class="file">contrib/test_summary</span></samp> shell script. Start it in the <var>objdir</var> with
202 1.1 mrg
203 1.10 mrg <pre class="smallexample"> <var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
204 1.10 mrg -m gcc-testresults (a] gcc.gnu.org |sh
205 1.10 mrg </pre>
206 1.10 mrg <p>This script uses the <samp><span class="command">Mail</span></samp> program to send the results, so
207 1.10 mrg make sure it is in your <samp><span class="env">PATH</span></samp>. The file <samp><span class="file">your_commentary.txt</span></samp> is
208 1.1 mrg prepended to the testsuite summary and should contain any special
209 1.1 mrg remarks you have on your results or your build environment. Please
210 1.1 mrg do not edit the testsuite result block or the subject line, as these
211 1.1 mrg messages may be automatically processed.
212 1.10 mrg
213 1.10 mrg <p><hr />
214 1.8 mrg <p><a href="./index.html">Return to the GCC Installation page</a>
215 1.1 mrg
216 1.10 mrg <!-- ***Final install*********************************************************** -->
217 1.10 mrg <!-- ***Binaries**************************************************************** -->
218 1.10 mrg <!-- ***Specific**************************************************************** -->
219 1.10 mrg <!-- ***Old documentation****************************************************** -->
220 1.10 mrg <!-- ***GFDL******************************************************************** -->
221 1.10 mrg <!-- *************************************************************************** -->
222 1.10 mrg <!-- Part 6 The End of the Document -->
223 1.10 mrg </body></html>
224 1.1 mrg
225