2017-10-07 00:16:47 +00:00
< html lang = "en" >
< head >
< title > Installing GCC: Testing< / title >
< meta http-equiv = "Content-Type" content = "text/html" >
< meta name = "description" content = "Installing GCC: Testing" >
< meta name = "generator" content = "makeinfo 4.13" >
< link title = "Top" rel = "top" href = "#Top" >
< link href = "http://www.gnu.org/software/texinfo/" rel = "generator-home" title = "Texinfo Homepage" >
<!--
Copyright (C) 1988-2017 Free Software Foundation, Inc.
2012-03-27 23:13:14 +00:00
2017-10-07 00:16:47 +00:00
Permission is granted to copy, distribute and/or modify this document
2012-03-27 23:13:14 +00:00
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, the Front-Cover texts being (a) (see below), and
with the Back-Cover Texts being (b) (see below). A copy of the
2017-10-07 00:16:47 +00:00
license is included in the section entitled "GNU Free Documentation License".
2012-03-27 23:13:14 +00:00
(a) The FSF's Front-Cover Text is:
2017-10-07 00:16:47 +00:00
A GNU Manual
2012-03-27 23:13:14 +00:00
(b) The FSF's Back-Cover Text is:
2017-10-07 00:16:47 +00:00
You have freedom to copy and modify this GNU Manual, like GNU
2012-03-27 23:13:14 +00:00
software. Copies published by the Free Software Foundation raise
2017-10-07 00:16:47 +00:00
funds for GNU development.-->
< meta http-equiv = "Content-Style-Type" content = "text/css" >
< style type = "text/css" > < ! - -
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
-->< / style >
2012-03-27 23:13:14 +00:00
< / head >
2017-10-07 00:16:47 +00:00
< body >
< h1 class = "settitle" > Installing GCC: Testing< / h1 >
< a name = "index-Testing-1" > < / a > < a name = "index-Installing-GCC_003a-Testing-2" > < / a > < a name = "index-Testsuite-3" > < / a >
Before you install GCC, we encourage you to run the testsuites and to
2012-03-27 23:13:14 +00:00
compare your results with results from a similar configuration that have
been submitted to the
2017-10-07 00:16:47 +00:00
< a href = "http://gcc.gnu.org/ml/gcc-testresults/" > gcc-testresults mailing list< / a > .
2012-03-27 23:13:14 +00:00
Some of these archived results are linked from the build status lists
at < a href = "http://gcc.gnu.org/buildstat.html" > http://gcc.gnu.org/buildstat.html< / a > , although not everyone who
2017-10-07 00:16:47 +00:00
reports a successful build runs the testsuites and submits the results.
2012-03-27 23:13:14 +00:00
This step is optional and may require you to download additional software,
but it can give you confidence in your new GCC installation or point out
problems before you install and start using your new GCC.
2017-10-07 00:16:47 +00:00
< p > First, you must have < a href = "download.html" > downloaded the testsuites< / a > .
2012-03-27 23:13:14 +00:00
These are part of the full distribution, but if you downloaded the
“ core” compiler plus any front ends, you must download the testsuites
separately.
2017-10-07 00:16:47 +00:00
< p > Second, you must have the testing tools installed. This includes
2012-03-27 23:13:14 +00:00
< a href = "http://www.gnu.org/software/dejagnu/" > DejaGnu< / a > , Tcl, and Expect;
2017-10-07 00:16:47 +00:00
the DejaGnu site has links to these. For running the BRIG frontend
tests, a tool to assemble the binary BRIGs from HSAIL text,
< a href = "https://github.com/HSAFoundation/HSAIL-Tools/" > HSAILasm< / a > must
be installed.
< p > If the directories where < samp > < span class = "command" > runtest< / span > < / samp > and < samp > < span class = "command" > expect< / span > < / samp > were
installed are not in the < samp > < span class = "env" > PATH< / span > < / samp > , you may need to set the following
2012-03-27 23:13:14 +00:00
environment variables appropriately, as in the following example (which
2017-10-07 00:16:47 +00:00
assumes that DejaGnu has been installed under < samp > < span class = "file" > /usr/local< / span > < / samp > ):
< pre class = "smallexample" > TCL_LIBRARY = /usr/local/share/tcl8.0
DEJAGNULIBS = /usr/local/share/dejagnu
< / pre >
< p > (On systems such as Cygwin, these paths are required to be actual
2012-03-27 23:13:14 +00:00
paths, not mounts or links; presumably this is due to some lack of
portability in the DejaGnu code.)
2017-10-07 00:16:47 +00:00
< p > Finally, you can run the testsuite (which may take a long time):
< pre class = "smallexample" > cd < var > objdir< / var > ; make -k check
< / pre >
< p > This will test various components of GCC, such as compiler
2012-03-27 23:13:14 +00:00
front ends and runtime libraries. While running the testsuite, DejaGnu
might emit some harmless messages resembling
2017-10-07 00:16:47 +00:00
‘ < samp > < span class = "samp" > WARNING: Couldn't find the global config file.< / span > < / samp > ’ or
‘ < samp > < span class = "samp" > WARNING: Couldn't find tool init file< / span > < / samp > ’ that can be ignored.
< p > If you are testing a cross-compiler, you may want to run the testsuite
2012-03-27 23:13:14 +00:00
on a simulator as described at < a href = "http://gcc.gnu.org/simtest-howto.html" > http://gcc.gnu.org/simtest-howto.html< / a > .
2017-10-07 00:16:47 +00:00
< h3 class = "section" > < a name = "TOC0" > < / a > How can you run the testsuite on selected tests?< / h3 >
2012-03-27 23:13:14 +00:00
< p > In order to run sets of tests selectively, there are targets
2017-10-07 00:16:47 +00:00
‘ < samp > < span class = "samp" > make check-gcc< / span > < / samp > ’ and language specific ‘ < samp > < span class = "samp" > make check-c< / span > < / samp > ’ ,
‘ < samp > < span class = "samp" > make check-c++< / span > < / samp > ’ , ‘ < samp > < span class = "samp" > make check-fortran< / span > < / samp > ’ ,
‘ < 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 > ’ ,
‘ < samp > < span class = "samp" > make check-lto< / span > < / samp > ’
in the < samp > < span class = "file" > gcc< / span > < / samp > subdirectory of the object directory. You can also
just run ‘ < samp > < span class = "samp" > make check< / span > < / samp > ’ in a subdirectory of the object directory.
< p > A more selective way to just run all < samp > < span class = "command" > gcc< / span > < / samp > execute tests in the
2012-03-27 23:13:14 +00:00
testsuite is to use
2017-10-07 00:16:47 +00:00
< pre class = "smallexample" > make check-gcc RUNTESTFLAGS="execute.exp < var > other-options< / var > "
< / pre >
< p > Likewise, in order to run only the < samp > < span class = "command" > g++< / span > < / samp > “ old-deja” tests in
the testsuite with filenames matching ‘ < samp > < span class = "samp" > 9805*< / span > < / samp > ’ , you would use
< pre class = "smallexample" > make check-g++ RUNTESTFLAGS="old-deja.exp=9805* < var > other-options< / var > "
< / pre >
< p > The < samp > < span class = "file" > *.exp< / span > < / samp > files are located in the testsuite directories of the GCC
source, the most important ones being < samp > < span class = "file" > compile.exp< / span > < / samp > ,
< 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 > .
To get a list of the possible < samp > < span class = "file" > *.exp< / span > < / samp > files, pipe the
output of ‘ < samp > < span class = "samp" > make check< / span > < / samp > ’ into a file and look at the
‘ < samp > < span class = "samp" > Running ... .exp< / span > < / samp > ’ lines.
< h3 class = "section" > < a name = "TOC1" > < / a > Passing options and running multiple testsuites< / h3 >
2012-03-27 23:13:14 +00:00
< p > You can pass multiple options to the testsuite using the
2017-10-07 00:16:47 +00:00
‘ < samp > < span class = "samp" > --target_board< / span > < / samp > ’ option of DejaGNU, either passed as part of
‘ < samp > < span class = "samp" > RUNTESTFLAGS< / span > < / samp > ’ , or directly to < samp > < span class = "command" > runtest< / span > < / samp > if you prefer to
2012-03-27 23:13:14 +00:00
work outside the makefiles. For example,
2017-10-07 00:16:47 +00:00
< pre class = "smallexample" > make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
< / pre >
< p > will run the standard < samp > < span class = "command" > g++< / span > < / samp > testsuites (“ unix” is the target name
2012-03-27 23:13:14 +00:00
for a standard native testsuite situation), passing
2017-10-07 00:16:47 +00:00
‘ < samp > < span class = "samp" > -O3 -fmerge-constants< / span > < / samp > ’ to the compiler on every test, i.e.,
2012-03-27 23:13:14 +00:00
slashes separate options.
2017-10-07 00:16:47 +00:00
< p > You can run the testsuites multiple times using combinations of options
2012-03-27 23:13:14 +00:00
with a syntax similar to the brace expansion of popular shells:
2017-10-07 00:16:47 +00:00
< pre class = "smallexample" > ..."--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}"
< / pre >
< p > (Note the empty option caused by the trailing comma in the final group.)
The following will run each testsuite eight times using the ‘ < samp > < span class = "samp" > arm-sim< / span > < / samp > ’
2012-03-27 23:13:14 +00:00
target, as if you had specified all possible combinations yourself:
2017-10-07 00:16:47 +00:00
< pre class = "smallexample" > --target_board='arm-sim/-mhard-float/-O1 \
arm-sim/-mhard-float/-O2 \
arm-sim/-mhard-float/-O3 \
arm-sim/-mhard-float \
arm-sim/-msoft-float/-O1 \
arm-sim/-msoft-float/-O2 \
arm-sim/-msoft-float/-O3 \
arm-sim/-msoft-float'
< / pre >
< p > They can be combined as many times as you wish, in arbitrary ways. This
2012-03-27 23:13:14 +00:00
list:
2017-10-07 00:16:47 +00:00
< pre class = "smallexample" > ..."--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}"
< / pre >
< p > will generate four combinations, all involving ‘ < samp > < span class = "samp" > -Wextra< / span > < / samp > ’ .
< p > The disadvantage to this method is that the testsuites are run in serial,
2012-03-27 23:13:14 +00:00
which is a waste on multiprocessor systems. For users with GNU Make and
a shell which performs brace expansion, you can run the testsuites in
2017-10-07 00:16:47 +00:00
parallel by having the shell perform the combinations and < samp > < span class = "command" > make< / span > < / samp >
do the parallel runs. Instead of using ‘ < samp > < span class = "samp" > --target_board< / span > < / samp > ’ , use a
2012-03-27 23:13:14 +00:00
special makefile target:
2017-10-07 00:16:47 +00:00
< pre class = "smallexample" > make -j< var > N< / var > check-< var > testsuite< / var > //< var > test-target< / var > /< var > option1< / var > /< var > option2< / var > /...
< / pre >
< p > For example,
< pre class = "smallexample" > make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
< / pre >
< p > will run three concurrent “ make-gcc” testsuites, eventually testing all
2012-03-27 23:13:14 +00:00
ten combinations as described above. Note that this is currently only
2017-10-07 00:16:47 +00:00
supported in the < samp > < span class = "file" > gcc< / span > < / samp > subdirectory. (To see how this works, try
typing < samp > < span class = "command" > echo< / span > < / samp > before the example given here.)
< h3 class = "section" > < a name = "TOC2" > < / a > How to interpret test results< / h3 >
< p > The result of running the testsuite are various < samp > < span class = "file" > *.sum< / span > < / samp > and < samp > < span class = "file" > *.log< / span > < / samp >
files in the testsuite subdirectories. The < samp > < span class = "file" > *.log< / span > < / samp > files contain a
2012-03-27 23:13:14 +00:00
detailed log of the compiler invocations and the corresponding
2017-10-07 00:16:47 +00:00
results, the < samp > < span class = "file" > *.sum< / span > < / samp > files summarize the results. These summaries
2012-03-27 23:13:14 +00:00
contain status codes for all tests:
2017-10-07 00:16:47 +00:00
< ul >
< li > PASS: the test passed as expected
< li > XPASS: the test unexpectedly passed
< li > FAIL: the test unexpectedly failed
< li > XFAIL: the test failed as expected
< li > UNSUPPORTED: the test is not supported on this platform
< li > ERROR: the testsuite detected an error
< li > WARNING: the testsuite detected a possible problem
< / ul >
< p > It is normal for some tests to report unexpected failures. At the
2012-03-27 23:13:14 +00:00
current time the testing harness does not allow fine grained control
over whether or not a test is expected to fail. This problem should
be fixed in future releases.
2017-10-07 00:16:47 +00:00
< h3 class = "section" > < a name = "TOC3" > < / a > Submitting test results< / h3 >
2012-03-27 23:13:14 +00:00
< p > If you want to report the results to the GCC project, use the
2017-10-07 00:16:47 +00:00
< samp > < span class = "file" > contrib/test_summary< / span > < / samp > shell script. Start it in the < var > objdir< / var > with
< pre class = "smallexample" > < var > srcdir< / var > /contrib/test_summary -p your_commentary.txt \
-m gcc-testresults@gcc.gnu.org |sh
< / pre >
< p > This script uses the < samp > < span class = "command" > Mail< / span > < / samp > program to send the results, so
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
2012-03-27 23:13:14 +00:00
prepended to the testsuite summary and should contain any special
remarks you have on your results or your build environment. Please
do not edit the testsuite result block or the subject line, as these
messages may be automatically processed.
2017-04-10 11:32:00 +00:00
2017-10-07 00:16:47 +00:00
< p > < hr / >
< p > < a href = "./index.html" > Return to the GCC Installation page< / a >
2012-03-27 23:13:14 +00:00
2017-10-07 00:16:47 +00:00
<!-- ***Final install*********************************************************** -->
<!-- ***Binaries**************************************************************** -->
<!-- ***Specific**************************************************************** -->
<!-- ***Old documentation****************************************************** -->
<!-- ***GFDL******************************************************************** -->
<!-- *************************************************************************** -->
<!-- Part 6 The End of the Document -->
< / body > < / html >
2012-03-27 23:13:14 +00:00