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