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