Home | History | Annotate | Line # | Download | only in INSTALL
test.html revision 1.15
      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.15  mrg <!-- Copyright (C) 1988-2022 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.15  mrg <a href="https://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.15  mrg at <a href="https://gcc.gnu.org/buildstat.html">https://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 &ldquo;core&rdquo; 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.15  mrg <a href="https://www.gnu.org/software/dejagnu/">DejaGnu</a>, Tcl, and Expect;
    108  1.15  mrg the DejaGnu site has links to these.
    109  1.15  mrg Some optional tests also require Python3 and pytest module.
    110  1.11  mrg </p>
    111  1.11  mrg <p>If the directories where <code>runtest</code> and <code>expect</code> were
    112  1.11  mrg installed are not in the <code>PATH</code>, you may need to set the following
    113   1.1  mrg environment variables appropriately, as in the following example (which
    114  1.11  mrg assumes that DejaGnu has been installed under <samp>/usr/local</samp>):
    115  1.11  mrg </p>
    116  1.14  mrg <div class="smallexample">
    117  1.14  mrg <pre class="smallexample">TCL_LIBRARY = /usr/local/share/tcl8.0
    118  1.11  mrg DEJAGNULIBS = /usr/local/share/dejagnu
    119  1.11  mrg </pre></div>
    120   1.1  mrg 
    121  1.11  mrg <p>(On systems such as Cygwin, these paths are required to be actual
    122   1.1  mrg paths, not mounts or links; presumably this is due to some lack of
    123   1.1  mrg portability in the DejaGnu code.)
    124  1.11  mrg </p>
    125  1.11  mrg 
    126  1.11  mrg <p>Finally, you can run the testsuite (which may take a long time):
    127  1.14  mrg </p><div class="smallexample">
    128  1.14  mrg <pre class="smallexample">cd <var>objdir</var>; make -k check
    129  1.11  mrg </pre></div>
    130   1.1  mrg 
    131  1.11  mrg <p>This will test various components of GCC, such as compiler
    132   1.1  mrg front ends and runtime libraries.  While running the testsuite, DejaGnu
    133   1.1  mrg might emit some harmless messages resembling
    134  1.11  mrg &lsquo;<samp>WARNING: Couldn't find the global config file.</samp>&rsquo; or
    135  1.11  mrg &lsquo;<samp>WARNING: Couldn't find tool init file</samp>&rsquo; that can be ignored.
    136  1.11  mrg </p>
    137  1.11  mrg <p>If you are testing a cross-compiler, you may want to run the testsuite
    138  1.15  mrg on a simulator as described at <a href="https://gcc.gnu.org/simtest-howto.html">https://gcc.gnu.org/simtest-howto.html</a>.
    139  1.11  mrg </p>
    140  1.14  mrg <a name="How-can-you-run-the-testsuite-on-selected-tests_003f"></a>
    141  1.11  mrg <h3 class="section">How can you run the testsuite on selected tests?</h3>
    142   1.1  mrg 
    143   1.1  mrg <p>In order to run sets of tests selectively, there are targets
    144  1.11  mrg &lsquo;<samp>make check-gcc</samp>&rsquo; and language specific &lsquo;<samp>make check-c</samp>&rsquo;,
    145  1.12  mrg &lsquo;<samp>make check-c++</samp>&rsquo;, &lsquo;<samp>make check-d</samp>&rsquo; &lsquo;<samp>make check-fortran</samp>&rsquo;,
    146  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;,
    147  1.11  mrg &lsquo;<samp>make check-lto</samp>&rsquo;
    148  1.11  mrg in the <samp>gcc</samp> subdirectory of the object directory.  You can also
    149  1.11  mrg just run &lsquo;<samp>make check</samp>&rsquo; in a subdirectory of the object directory.
    150  1.11  mrg </p>
    151   1.1  mrg 
    152  1.11  mrg <p>A more selective way to just run all <code>gcc</code> execute tests in the
    153   1.1  mrg testsuite is to use
    154  1.11  mrg </p>
    155  1.14  mrg <div class="smallexample">
    156  1.14  mrg <pre class="smallexample">make check-gcc RUNTESTFLAGS=&quot;execute.exp <var>other-options</var>&quot;
    157  1.11  mrg </pre></div>
    158  1.11  mrg 
    159  1.11  mrg <p>Likewise, in order to run only the <code>g++</code> &ldquo;old-deja&rdquo; tests in
    160  1.11  mrg the testsuite with filenames matching &lsquo;<samp>9805*</samp>&rsquo;, you would use
    161  1.11  mrg </p>
    162  1.14  mrg <div class="smallexample">
    163  1.14  mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;old-deja.exp=9805* <var>other-options</var>&quot;
    164  1.11  mrg </pre></div>
    165  1.11  mrg 
    166  1.11  mrg <p>The file-matching expression following <var>filename</var><code>.exp=</code> is treated
    167  1.11  mrg as a series of whitespace-delimited glob expressions so that multiple patterns
    168  1.11  mrg may be passed, although any whitespace must either be escaped or surrounded by
    169  1.11  mrg single quotes if multiple expressions are desired. For example,
    170  1.11  mrg </p>
    171  1.14  mrg <div class="smallexample">
    172  1.14  mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;old-deja.exp=9805*\ virtual2.c <var>other-options</var>&quot;
    173  1.11  mrg make check-g++ RUNTESTFLAGS=&quot;'old-deja.exp=9805* virtual2.c' <var>other-options</var>&quot;
    174  1.11  mrg </pre></div>
    175  1.11  mrg 
    176  1.11  mrg <p>The <samp>*.exp</samp> files are located in the testsuite directories of the GCC
    177  1.11  mrg source, the most important ones being <samp>compile.exp</samp>,
    178  1.11  mrg <samp>execute.exp</samp>, <samp>dg.exp</samp> and <samp>old-deja.exp</samp>.
    179  1.11  mrg To get a list of the possible <samp>*.exp</samp> files, pipe the
    180  1.11  mrg output of &lsquo;<samp>make check</samp>&rsquo; into a file and look at the
    181  1.11  mrg &lsquo;<samp>Running &hellip;  .exp</samp>&rsquo; lines.
    182  1.11  mrg </p>
    183  1.14  mrg <a name="Passing-options-and-running-multiple-testsuites"></a>
    184  1.11  mrg <h3 class="section">Passing options and running multiple testsuites</h3>
    185   1.1  mrg 
    186   1.1  mrg <p>You can pass multiple options to the testsuite using the
    187  1.11  mrg &lsquo;<samp>--target_board</samp>&rsquo; option of DejaGNU, either passed as part of
    188  1.11  mrg &lsquo;<samp>RUNTESTFLAGS</samp>&rsquo;, or directly to <code>runtest</code> if you prefer to
    189   1.1  mrg work outside the makefiles.  For example,
    190  1.11  mrg </p>
    191  1.14  mrg <div class="smallexample">
    192  1.14  mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;--target_board=unix/-O3/-fmerge-constants&quot;
    193  1.11  mrg </pre></div>
    194   1.1  mrg 
    195  1.11  mrg <p>will run the standard <code>g++</code> testsuites (&ldquo;unix&rdquo; is the target name
    196   1.1  mrg for a standard native testsuite situation), passing
    197  1.11  mrg &lsquo;<samp>-O3 -fmerge-constants</samp>&rsquo; to the compiler on every test, i.e.,
    198   1.1  mrg slashes separate options.
    199  1.11  mrg </p>
    200  1.11  mrg <p>You can run the testsuites multiple times using combinations of options
    201   1.1  mrg with a syntax similar to the brace expansion of popular shells:
    202  1.11  mrg </p>
    203  1.14  mrg <div class="smallexample">
    204  1.14  mrg <pre class="smallexample">&hellip;&quot;--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}&quot;
    205  1.11  mrg </pre></div>
    206   1.1  mrg 
    207  1.11  mrg <p>(Note the empty option caused by the trailing comma in the final group.)
    208  1.11  mrg The following will run each testsuite eight times using the &lsquo;<samp>arm-sim</samp>&rsquo;
    209   1.1  mrg target, as if you had specified all possible combinations yourself:
    210  1.11  mrg </p>
    211  1.14  mrg <div class="smallexample">
    212  1.14  mrg <pre class="smallexample">--target_board='arm-sim/-mhard-float/-O1 \
    213  1.11  mrg                 arm-sim/-mhard-float/-O2 \
    214  1.11  mrg                 arm-sim/-mhard-float/-O3 \
    215  1.11  mrg                 arm-sim/-mhard-float \
    216  1.11  mrg                 arm-sim/-msoft-float/-O1 \
    217  1.11  mrg                 arm-sim/-msoft-float/-O2 \
    218  1.11  mrg                 arm-sim/-msoft-float/-O3 \
    219  1.11  mrg                 arm-sim/-msoft-float'
    220  1.11  mrg </pre></div>
    221   1.1  mrg 
    222  1.11  mrg <p>They can be combined as many times as you wish, in arbitrary ways.  This
    223   1.1  mrg list:
    224  1.11  mrg </p>
    225  1.14  mrg <div class="smallexample">
    226  1.14  mrg <pre class="smallexample">&hellip;&quot;--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}&quot;
    227  1.11  mrg </pre></div>
    228  1.11  mrg 
    229  1.11  mrg <p>will generate four combinations, all involving &lsquo;<samp>-Wextra</samp>&rsquo;.
    230  1.11  mrg </p>
    231  1.11  mrg <p>The disadvantage to this method is that the testsuites are run in serial,
    232   1.1  mrg which is a waste on multiprocessor systems.  For users with GNU Make and
    233   1.1  mrg a shell which performs brace expansion, you can run the testsuites in
    234  1.11  mrg parallel by having the shell perform the combinations and <code>make</code>
    235  1.11  mrg do the parallel runs.  Instead of using &lsquo;<samp>--target_board</samp>&rsquo;, use a
    236   1.1  mrg special makefile target:
    237  1.11  mrg </p>
    238  1.14  mrg <div class="smallexample">
    239  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>/&hellip;
    240  1.11  mrg </pre></div>
    241  1.11  mrg 
    242  1.11  mrg <p>For example,
    243  1.11  mrg </p>
    244  1.14  mrg <div class="smallexample">
    245  1.14  mrg <pre class="smallexample">make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
    246  1.11  mrg </pre></div>
    247   1.1  mrg 
    248  1.11  mrg <p>will run three concurrent &ldquo;make-gcc&rdquo; testsuites, eventually testing all
    249   1.1  mrg ten combinations as described above.  Note that this is currently only
    250  1.11  mrg supported in the <samp>gcc</samp> subdirectory.  (To see how this works, try
    251  1.11  mrg typing <code>echo</code> before the example given here.)
    252  1.11  mrg </p>
    253  1.10  mrg 
    254  1.14  mrg <a name="How-to-interpret-test-results"></a>
    255  1.11  mrg <h3 class="section">How to interpret test results</h3>
    256   1.1  mrg 
    257  1.11  mrg <p>The result of running the testsuite are various <samp>*.sum</samp> and <samp>*.log</samp>
    258  1.11  mrg files in the testsuite subdirectories.  The <samp>*.log</samp> files contain a
    259   1.1  mrg detailed log of the compiler invocations and the corresponding
    260  1.11  mrg results, the <samp>*.sum</samp> files summarize the results.  These summaries
    261   1.1  mrg contain status codes for all tests:
    262  1.11  mrg </p>
    263  1.11  mrg <ul>
    264  1.11  mrg <li> PASS: the test passed as expected
    265  1.11  mrg </li><li> XPASS: the test unexpectedly passed
    266  1.11  mrg </li><li> FAIL: the test unexpectedly failed
    267  1.11  mrg </li><li> XFAIL: the test failed as expected
    268  1.11  mrg </li><li> UNSUPPORTED: the test is not supported on this platform
    269  1.11  mrg </li><li> ERROR: the testsuite detected an error
    270  1.11  mrg </li><li> WARNING: the testsuite detected a possible problem
    271  1.11  mrg </li></ul>
    272   1.1  mrg 
    273  1.11  mrg <p>It is normal for some tests to report unexpected failures.  At the
    274   1.1  mrg current time the testing harness does not allow fine grained control
    275   1.1  mrg over whether or not a test is expected to fail.  This problem should
    276   1.1  mrg be fixed in future releases.
    277  1.11  mrg </p>
    278   1.1  mrg 
    279  1.14  mrg <a name="Submitting-test-results"></a>
    280  1.11  mrg <h3 class="section">Submitting test results</h3>
    281   1.1  mrg 
    282   1.1  mrg <p>If you want to report the results to the GCC project, use the
    283  1.11  mrg <samp>contrib/test_summary</samp> shell script.  Start it in the <var>objdir</var> with
    284  1.11  mrg </p>
    285  1.14  mrg <div class="smallexample">
    286  1.14  mrg <pre class="smallexample"><var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
    287  1.11  mrg     -m gcc-testresults (a] gcc.gnu.org |sh
    288  1.11  mrg </pre></div>
    289   1.1  mrg 
    290  1.11  mrg <p>This script uses the <code>Mail</code> program to send the results, so
    291  1.11  mrg make sure it is in your <code>PATH</code>.  The file <samp>your_commentary.txt</samp> is
    292   1.1  mrg prepended to the testsuite summary and should contain any special
    293   1.1  mrg remarks you have on your results or your build environment.  Please
    294   1.1  mrg do not edit the testsuite result block or the subject line, as these
    295   1.1  mrg messages may be automatically processed.
    296  1.11  mrg </p>
    297  1.11  mrg <hr />
    298  1.11  mrg <p>
    299  1.11  mrg <p><a href="./index.html">Return to the GCC Installation page</a>
    300  1.11  mrg </p>
    301  1.11  mrg 
    302  1.11  mrg 
    303  1.11  mrg 
    304  1.11  mrg 
    305  1.11  mrg 
    306  1.14  mrg <hr>
    307  1.10  mrg 
    308   1.1  mrg 
    309   1.1  mrg 
    310  1.11  mrg </body>
    311  1.11  mrg </html>
    312