blob: 1e19db7a2acb3817ccebaab46096002bb9299f7d [file] [log] [blame]
Misha Brukman1d83e112004-03-01 18:21:04 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
John Criswell020cbd82003-10-10 18:42:49 +00003<html>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +00004<head>
Misha Brukman1d83e112004-03-01 18:21:04 +00005 <title>LLVM Test Suite Guide</title>
6 <link rel="stylesheet" href="llvm.css" type="text/css">
Brian Gaekeaf19f2e2003-10-23 18:10:28 +00007</head>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +00008<body>
9
10<div class="doc_title">
11 LLVM Test Suite Guide
12</div>
John Criswell020cbd82003-10-10 18:42:49 +000013
Brian Gaekeaf19f2e2003-10-23 18:10:28 +000014<ol>
15<li><a href="#overview">Overview</a></li>
16<li><a href="#Requirements">Requirements</a></li>
17<li><a href="#quick">Quick Start</a></li>
Misha Brukman1d83e112004-03-01 18:21:04 +000018<li><a href="#org">LLVM Test Suite Organization</a>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +000019<ul>
20 <li><a href="#codefragments">Code Fragments</a></li>
Reid Spencer8284f1f2004-09-05 20:07:26 +000021<li><a href="#wholeprograms">Whole Programs</a></li>
Misha Brukman1d83e112004-03-01 18:21:04 +000022</ul></li>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +000023<li><a href="#tree">LLVM Test Suite Tree</a></li>
24<li><a href="#qmstructure">QMTest Structure</a></li>
Reid Spencer8284f1f2004-09-05 20:07:26 +000025<li><a href="#progstructure"><tt>llvm-test</tt> Structure</a></li>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +000026<li><a href="#run">Running the LLVM Tests</a></li>
Chris Lattnerfd9d1b32004-06-24 20:53:09 +000027<li><a href="#nightly">Running the nightly tester</a></li>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +000028</ol>
John Criswell020cbd82003-10-10 18:42:49 +000029
Chris Lattner7911ce22004-05-23 21:07:27 +000030<div class="doc_author">
Reid Spencer8284f1f2004-09-05 20:07:26 +000031<p>Written by John T. Criswell</p>
Chris Lattner7911ce22004-05-23 21:07:27 +000032</div>
John Criswell020cbd82003-10-10 18:42:49 +000033
Reid Spencer8284f1f2004-09-05 20:07:26 +000034<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +000035<div class="doc_section"><a name="overview">Overview</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +000036<!--=========================================================================-->
John Criswell020cbd82003-10-10 18:42:49 +000037
Misha Brukman1d83e112004-03-01 18:21:04 +000038<div class="doc_text">
John Criswell020cbd82003-10-10 18:42:49 +000039
Misha Brukman1d83e112004-03-01 18:21:04 +000040<p>This document is the reference manual for the LLVM test suite. It documents
41the structure of the LLVM test suite, the tools needed to use it, and how to add
42and run tests.</p>
John Criswell020cbd82003-10-10 18:42:49 +000043
Misha Brukman1d83e112004-03-01 18:21:04 +000044</div>
John Criswell020cbd82003-10-10 18:42:49 +000045
Reid Spencer8284f1f2004-09-05 20:07:26 +000046<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +000047<div class="doc_section"><a name="Requirements">Requirements</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +000048<!--=========================================================================-->
John Criswell020cbd82003-10-10 18:42:49 +000049
Misha Brukman1d83e112004-03-01 18:21:04 +000050<div class="doc_text">
John Criswell020cbd82003-10-10 18:42:49 +000051
Misha Brukman1d83e112004-03-01 18:21:04 +000052<p>In order to use the LLVM test suite, you will need all of the software
53required to build LLVM, plus the following:</p>
John Criswell020cbd82003-10-10 18:42:49 +000054
Misha Brukman1d83e112004-03-01 18:21:04 +000055<dl>
Reid Spencer8284f1f2004-09-05 20:07:26 +000056<dt><a href="http://www.qmtest.com">QMTest</A></dt>
57<dd>The LLVM test suite uses QMTest to organize and run tests. <b>Note:
58you will need <a href="http://llvm.cs.uiuc.edu/qm-2.0.3.tar.gz">QMTest
592.0.3 (source tar.gz file)</a> to be successful. The tests do not run with
60any other version.</b></dd>
John Criswell020cbd82003-10-10 18:42:49 +000061
Reid Spencer8284f1f2004-09-05 20:07:26 +000062<dt><a href="http://www.python.org">Python</A></dt>
63<dd>You will need a Python interpreter that works with QMTest. Python will
64need zlib and SAX support enabled.</dd>
Misha Brukman1d83e112004-03-01 18:21:04 +000065</dl>
John Criswell020cbd82003-10-10 18:42:49 +000066
Misha Brukman1d83e112004-03-01 18:21:04 +000067</div>
John Criswell020cbd82003-10-10 18:42:49 +000068
Reid Spencer8284f1f2004-09-05 20:07:26 +000069<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +000070<div class="doc_section"><a name="quick">Quick Start</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +000071<!--=========================================================================-->
John Criswell020cbd82003-10-10 18:42:49 +000072
Misha Brukman1d83e112004-03-01 18:21:04 +000073<div class="doc_text">
Brian Gaekeaf19f2e2003-10-23 18:10:28 +000074
Reid Spencer8284f1f2004-09-05 20:07:26 +000075<p>The tests are located in two separate CVS modules. The basic feature and
76regression tests are in the main "llvm" module under the directory
77<tt>llvm/test</tt>. A more comprehensive test suite that includes whole
78programs in C and C++ is in the <tt>llvm-test</tt> module. This module should
79be checked out to the <tt>llvm/projects</tt> directory. When you
80<tt>configure</tt> the <tt>llvm</tt> module, the <tt>llvm-test</tt> module
81will be automatically configured. Or you can do it manually.</p>
82<p>To run all of the simple tests in LLVM, use the master Makefile in the
83<tt>llvm/test</tt> directory:</p>
Misha Brukman1d83e112004-03-01 18:21:04 +000084<pre>
Reid Spencer8284f1f2004-09-05 20:07:26 +000085% gmake -C llvm/test
Misha Brukman1d83e112004-03-01 18:21:04 +000086</pre>
John Criswell020cbd82003-10-10 18:42:49 +000087
Misha Brukman1d83e112004-03-01 18:21:04 +000088<p>To run only the code fragment tests (i.e. those that do basic testing of
89LLVM), run the tests organized by QMTest:</p>
Misha Brukman1d83e112004-03-01 18:21:04 +000090<pre>
Reid Spencer8284f1f2004-09-05 20:07:26 +000091% gmake -C llvm/test qmtest
Misha Brukman1d83e112004-03-01 18:21:04 +000092</pre>
John Criswell020cbd82003-10-10 18:42:49 +000093
Reid Spencer8284f1f2004-09-05 20:07:26 +000094<p>To run only the basic feature tests, QMTest supports the following
95target:</p>
96<pre>
97% gmake -C llvm/test Feature.t
98</pre>
99
100<p>To run only the regression tests, QMTest supports the following
101target:</p>
102<pre>
103% gmake -C llvm/test Regression.t
104</pre>
105
106<p>To run the comprehensive test suite (tests that compile and execute whole
107programs), run the <tt>llvm-test</tt> tests:</p>
John Criswell020cbd82003-10-10 18:42:49 +0000108
Misha Brukman1d83e112004-03-01 18:21:04 +0000109<pre>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000110% cd llvm/projects
111% cvs co llvm-test
112% cd llvm-test
113% ./configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT
114% gmake
Misha Brukman1d83e112004-03-01 18:21:04 +0000115</pre>
116
117</div>
118
Reid Spencer8284f1f2004-09-05 20:07:26 +0000119<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000120<div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000121<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000122
123<div class="doc_text">
124
125<p>The LLVM test suite contains two major categories of tests: code
Reid Spencer8284f1f2004-09-05 20:07:26 +0000126fragments and whole programs. Code fragments are in the <tt>llvm</tt> module
127under the directory under the <tt>llvm/test</tt> directory. The whole programs
128test suite are n the <tt>llvm-test</tt> module under the main directory.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000129
130</div>
131
132<div class="doc_subsection"><a name="codefragments">Code Fragments</a>
133</div>
134
135<div class="doc_text">
136
137<p>Code fragments are small pieces of code that test a specific feature of LLVM
138or trigger a specific bug in LLVM. They are usually written in LLVM assembly
139language, but can be written in other languages if the test targets a particular
140language front end.</p>
141
142<p>Code fragments are not complete programs, and they are never executed to
143determine correct behavior.</p>
144
Reid Spencer8284f1f2004-09-05 20:07:26 +0000145<p>Thes code fragment tests are located in the <tt>llvm/test/Features</tt> and
146<tt>llvm/test/Regression</tt> directories.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000147
148</div>
149
150<div class="doc_subsection"><a name="wholeprograms">Whole Programs</a></div>
151
152<div class="doc_text">
153
154<p>Whole Programs are pieces of code which can be compiled and linked into a
155stand-alone program that can be executed. These programs are generally written
156in high level languages such as C or C++, but sometimes they are written
157straight in LLVM assembly.</p>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000158
Misha Brukman1d83e112004-03-01 18:21:04 +0000159<p>These programs are compiled and then executed using several different
160methods (native compiler, LLVM C backend, LLVM JIT, LLVM native code generation,
161etc). The output of these programs is compared to ensure that LLVM is compiling
162the program correctly.</p>
163
164<p>In addition to compiling and executing programs, whole program tests serve as
165a way of benchmarking LLVM performance, both in terms of the efficiency of the
166programs generated as well as the speed with which LLVM compiles, optimizes, and
167generates code.</p>
168
Reid Spencer8284f1f2004-09-05 20:07:26 +0000169<p>All "whole program" tests are located in the <tt>llvm-test</tt> CVS
170module.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000171
172</div>
173
Reid Spencer8284f1f2004-09-05 20:07:26 +0000174<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000175<div class="doc_section"><a name="tree">LLVM Test Suite Tree</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000176<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000177
178<div class="doc_text">
179
180<p>Each type of test in the LLVM test suite has its own directory. The major
181subtrees of the test suite directory tree are as follows:</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000182
Reid Spencer8284f1f2004-09-05 20:07:26 +0000183<ul>
184<li><tt>llvm/test/Features</tt>
185<p>This directory contains sample codes that test various features of the
186LLVM language. These pieces of sample code are run through various
187assembler, disassembler, and optimizer passes.</p>
188</li>
Misha Brukman1d83e112004-03-01 18:21:04 +0000189
Reid Spencer8284f1f2004-09-05 20:07:26 +0000190<li><tt>llvm/test/Regression</tt>
191<p>This directory contains regression tests for LLVM. When a bug is found
192in LLVM, a regression test containing just enough code to reproduce the
193problem should be written and placed somewhere underneath this directory.
194In most cases, this will be a small piece of LLVM assembly language code,
195often distilled from an actual application or benchmark.</p>
196</li>
Misha Brukman1d83e112004-03-01 18:21:04 +0000197
Reid Spencer8284f1f2004-09-05 20:07:26 +0000198<li><tt>llvm-test</tt>
199<p>The <tt>llvm-test</tt> CVS module contains programs that can be compiled
200with LLVM and executed. These programs are compiled using the native compiler
201and various LLVM backends. The output from the program compiled with the
202native compiler is assumed correct; the results from the other programs are
203compared to the native program output and pass if they match. </p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000204
Reid Spencer8284f1f2004-09-05 20:07:26 +0000205<p>In addition for testing correctness, the <tt>llvm-test</tt> directory also
206performs timing tests of various LLVM optimizations. It also records
207compilation times for the compilers and the JIT. This information can be
208used to compare the effectiveness of LLVM's optimizations and code
209generation.</p></li>
John Criswell020cbd82003-10-10 18:42:49 +0000210
Reid Spencer8284f1f2004-09-05 20:07:26 +0000211<li><tt>llvm-test/SingleSource</tt>
212<p>The SingleSource directory contains test programs that are only a single
213source file in size. These are usually small benchmark programs or small
214programs that calculate a particular value. Several such programs are grouped
215together in each directory.</p></li>
216
217<li><tt>llvm-test/MultiSource</tt>
218<p>The MultiSource directory contains subdirectories which contain entire
219programs with multiple source files. Large benchmarks and whole applications
220go here.</p></li>
221
222<li><tt>llvm-test/External</tt>
223<p>The External directory contains Makefiles for building code that is
224external to (i.e. not distributed with) LLVM. The most prominent member
225of this directory is the SPEC 2000 benchmark suite. The presence and
226location of these external programs is configured by the llvm-test
227<tt>configure</tt> script.</p></li>
228
229<li><tt>llvm/test/QMTest</tt>
230<p>This directory contains the QMTest information files. Inside this
231directory are QMTest administration files and the Python code that
232implements the LLVM test and database classes.</p>
John Criswell020cbd82003-10-10 18:42:49 +0000233
Misha Brukman1d83e112004-03-01 18:21:04 +0000234</ul>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +0000235
Misha Brukman1d83e112004-03-01 18:21:04 +0000236</div>
John Criswell020cbd82003-10-10 18:42:49 +0000237
Reid Spencer8284f1f2004-09-05 20:07:26 +0000238<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000239<div class="doc_section"><a name="qmstructure">QMTest Structure</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000240<!--=========================================================================-->
John Criswell020cbd82003-10-10 18:42:49 +0000241
Misha Brukman1d83e112004-03-01 18:21:04 +0000242<div class="doc_text">
John Criswell020cbd82003-10-10 18:42:49 +0000243
Misha Brukman1d83e112004-03-01 18:21:04 +0000244<p>The LLVM test suite is partially driven by QMTest and partially
245driven by GNU Make. Specifically, the Features and Regression tests
Reid Spencer8284f1f2004-09-05 20:07:26 +0000246are all driven by QMTest. The <tt>llvm-test</tt> module is currently
Misha Brukman1d83e112004-03-01 18:21:04 +0000247driven by a set of Makefiles.</p>
John Criswell020cbd82003-10-10 18:42:49 +0000248
Misha Brukman1d83e112004-03-01 18:21:04 +0000249<p>The QMTest system needs to have several pieces of information
250available; these pieces of configuration information are known
251collectively as the "context" in QMTest parlance. Since the context
252for LLVM is relatively large, the master Makefile in llvm/test
253sets it for you.</p>
John Criswell020cbd82003-10-10 18:42:49 +0000254
Misha Brukman1d83e112004-03-01 18:21:04 +0000255<p>The LLVM database class makes the subdirectories of llvm/test a
256QMTest test database. For each directory that contains tests driven by
257QMTest, it knows what type of test the source file is and how to run it.</p>
John Criswell020cbd82003-10-10 18:42:49 +0000258
Misha Brukman1d83e112004-03-01 18:21:04 +0000259<p>Hence, the QMTest namespace is essentially what you see in the
260Feature and Regression directories, but there is some magic that
261the database class performs (as described below).</p>
John Criswell020cbd82003-10-10 18:42:49 +0000262
Misha Brukman1d83e112004-03-01 18:21:04 +0000263<p>The QMTest namespace is currently composed of the following tests and test
264suites:</p>
John Criswell020cbd82003-10-10 18:42:49 +0000265
Misha Brukman1d83e112004-03-01 18:21:04 +0000266<ul>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000267<li>Feature
268 <p>
269These are the feature tests found in the Feature directory.
270They are broken up into the following categories:
271 </p>
272<ul>
273 <li>ad
274 <p>Assembler/Disassembler tests. These tests verify that a piece of LLVM
275 assembly language can be assembled into bytecode and then disassembled
276 into the original assembly language code. It does this several times to
277 ensure that assembled output can be disassembled and disassembler output
278 can be assembled. It also verifies that the give assembly language file
279 can be assembled correctly.</p></li>
John Criswell020cbd82003-10-10 18:42:49 +0000280
Reid Spencer8284f1f2004-09-05 20:07:26 +0000281 <li>opt
282 <p>Optimizer tests. These tests verify that two of the optimizer passes
283 completely optimize a program (i.e. after a single pass, they cannot
284 optimize a program any further).</p></li>
John Criswell020cbd82003-10-10 18:42:49 +0000285
Reid Spencer8284f1f2004-09-05 20:07:26 +0000286 <li>mc
287 <p> Machine code tests. These tests verify that the LLVM assembly
288 language file can be translated into native assembly code.</p></li>
John Criswell020cbd82003-10-10 18:42:49 +0000289
Reid Spencer8284f1f2004-09-05 20:07:26 +0000290 <li>cc
291 <p>C code tests. These tests verify that the specified LLVM assembly
292 code can be converted into C source code using the C backend.</p></li>
293</ul>
John Criswell020cbd82003-10-10 18:42:49 +0000294
Reid Spencer8284f1f2004-09-05 20:07:26 +0000295<p>The LLVM database class looks at every file in the Feature directory and
296creates a fake test hierarchy containing
297<tt>Feature.&lt;testtype&gt;.&lt;testname&gt;</tt>. So, if you add an LLVM
298assembly language file to the Feature directory, it actually creates 5 new
299tests: assembler/disassembler, assembler, optimizer, machine code, and C code.
300</p>
John Criswell020cbd82003-10-10 18:42:49 +0000301
Reid Spencer8284f1f2004-09-05 20:07:26 +0000302<li>Regression
303 <p>These are the regression tests. There is one suite for each
304 subdirectory of the Regression directory. If you add a new subdirectory
305 there, you will need to modify, at least, the <tt>RegressionMap</tt>
306 variable in <tt>QMTest/llvmdb.py</tt> so that QMTest knows how to run the
307 tests in the new subdirectory.</p>
John Criswell020cbd82003-10-10 18:42:49 +0000308
Misha Brukman1d83e112004-03-01 18:21:04 +0000309</ul>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000310
Misha Brukman1d83e112004-03-01 18:21:04 +0000311</div>
John Criswell020cbd82003-10-10 18:42:49 +0000312
Reid Spencer8284f1f2004-09-05 20:07:26 +0000313<!--=========================================================================-->
314<div class="doc_section"><a name="progstructure"><tt>llvm-test</tt>
315Structure</a></div>
316<!--=========================================================================-->
John Criswell020cbd82003-10-10 18:42:49 +0000317
Misha Brukman1d83e112004-03-01 18:21:04 +0000318<div class="doc_text">
Brian Gaekeaf19f2e2003-10-23 18:10:28 +0000319
Reid Spencer8284f1f2004-09-05 20:07:26 +0000320 <p>As mentioned previously, the <tt>llvm-test</tt> module provides three
321 types of tests: MultiSource, SingleSource, and External. Each tree is then
322 subdivided into several categories, including applications, benchmarks,
323 regression tests, code that is strange grammatically, etc. These
324 organizations should be relatively self explanatory.</p>
John Criswell020cbd82003-10-10 18:42:49 +0000325
Reid Spencer8284f1f2004-09-05 20:07:26 +0000326 <p>In addition to the regular "whole program" tests, the <tt>llvm-test</tt>
327 module also provides a mechanism for compiling the programs in different ways.
328 If the variable TEST is defined on the gmake command line, the test system will
329 include a Makefile named <tt>TEST.&lt;value of TEST variable&gt;.Makefile</tt>.
330 This Makefile can modify build rules to yield different results.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000331
Reid Spencer8284f1f2004-09-05 20:07:26 +0000332 <p>For example, the LLVM nightly tester uses <tt>TEST.nightly.Makefile</tt> to
333 create the nightly test reports. To run the nightly tests, run <tt>gmake
334 TEST=nightly</tt>.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000335
Reid Spencer8284f1f2004-09-05 20:07:26 +0000336 <p>There are several TEST Makefiles available in the tree. Some of them are
337 designed for internal LLVM research and will not work outside of the LLVM
338 research group. They may still be valuable, however, as a guide to writing your
339 own TEST Makefile for any optimization or analysis passes that you develop with
340 LLVM.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000341
342</div>
343
Reid Spencer8284f1f2004-09-05 20:07:26 +0000344<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000345<div class="doc_section"><a name="run">Running the LLVM Tests</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000346<!--=========================================================================-->
Misha Brukman1d83e112004-03-01 18:21:04 +0000347
348<div class="doc_text">
349
350<p>First, all tests are executed within the LLVM object directory tree. They
Reid Spencer8284f1f2004-09-05 20:07:26 +0000351<i>are not</i> executed inside of the LLVM source tree. This is because the
352test suite creates temporary files during execution.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000353
Reid Spencer8284f1f2004-09-05 20:07:26 +0000354<p>The master Makefile in llvm/test is capable of running only the QMTest driven
355tests. By default, it will run all of these tests.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000356
357<p>To run only the QMTest driven tests, run <tt>gmake qmtest</tt> at the
358command line in llvm/tests. To run a specific qmtest, suffix the test name with
359".t" when running gmake.</p>
360
Reid Spencer8284f1f2004-09-05 20:07:26 +0000361<p>For example, to run the Regression.LLC tests, type
362<tt>gmake Regression.LLC.t</tt> in <tt>llvm/tests</tt>.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000363
Reid Spencer8284f1f2004-09-05 20:07:26 +0000364<p>Note that there are no Makefiles in <tt>llvm/test/Features</tt> and
365<tt>llvm/test/Regression</tt>. You must use QMTest from the <tt>llvm/test</tt>
366directory to run them.</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000367
Reid Spencer8284f1f2004-09-05 20:07:26 +0000368<p>To run the <tt>llvm-test</tt> suite, you need to use the following steps:
369</p>
370<ol>
371 <li>cd into the llvm/projects directory</li>
372 <li>check out the <tt>llvm-test</tt> module with:<br/>
373 <tt>cvs -d :pserver:anon@llvm.cs.uiuc.edu:/var/cvs/llvm co -PR llvm-test</tt><br>
374 This will get the test suite into <tt>llvm/projects/llvm-test</tt></li>
375 <li>configure the test suite. You can do this one of two ways:
376 <ol>
377 <li>Use the regular llvm configure:<br/>
378 <tt>cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure</tt><br/>
379 This will ensure that the <tt>projects/llvm-test</tt> directory is also
380 properly configured.</li>
381 <li>Use the <tt>configure</tt> script found in the <tt>llvm-test</tt> source
382 directory:<br/>
383 <tt>$BUILD_SRC_DIR/configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT</tt>
384 </li>
385 </ol>
386 <li>gmake</li>
387</ol>
388<p>Note that the second and third steps only need to be done once. After you
389have the suite checked out and configured, you don't need to do it again (unless
390the test code or configure script changes).</p>
391
392<p>To make a specialized test (use one of the
393<tt>llvm-test/TEST.&lt;type&gt;.Makefile</tt>s), just run:<br/>
394<tt>gmake TEST=&lt;type&gt; test</tt><br/>For example, you could run the
Misha Brukman1d83e112004-03-01 18:21:04 +0000395nightly tester tests using the following commands:</p>
396
397<pre>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000398 % cd llvm/projects/llvm-test
Misha Brukman1d83e112004-03-01 18:21:04 +0000399 % gmake TEST=nightly test
400</pre>
401
402<p>Regardless of which test you're running, the results are printed on standard
403output and standard error. You can redirect these results to a file if you
404choose.</p>
405
406<p>Some tests are known to fail. Some are bugs that we have not fixed yet;
407others are features that we haven't added yet (or may never add). In QMTest,
408the result for such tests will be XFAIL (eXpected FAILure). In this way, you
409can tell the difference between an expected and unexpected failure.</p>
410
Reid Spencer8284f1f2004-09-05 20:07:26 +0000411<p>The tests in <tt>llvm-test</tt> have no such feature as of this time. If
412the test passes, only warnings and other miscellaneous output will be generated.
413If a test fails, a large &lt;program&gt; FAILED message will be displayed.
414This will help you separate benign warnings from actual test failures.</p>
Chris Lattnerfd9d1b32004-06-24 20:53:09 +0000415
416</div>
417
Reid Spencer8284f1f2004-09-05 20:07:26 +0000418<!--=========================================================================-->
Chris Lattnerfd9d1b32004-06-24 20:53:09 +0000419<div class="doc_section"><a name="nightly">Running the nightly tester</a></div>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000420<!--=========================================================================-->
Chris Lattnerfd9d1b32004-06-24 20:53:09 +0000421
422<div class="doc_text">
423
424<p>
425The <a href="http://llvm.cs.uiuc.edu/testresults/">LLVM Nightly Testers</a>
426automatically check out an LLVM tree, build it, run the "nightly"
Reid Spencer8284f1f2004-09-05 20:07:26 +0000427program test (described above), run all of the feature and regression tests,
428and then delete the checked out tree. This tester is designed to ensure that
Chris Lattnerfd9d1b32004-06-24 20:53:09 +0000429programs don't break as well as keep track of LLVM's progress over time.</p>
430
431<p>
432If you'd like to set up an instance of the nightly tester to run on your
433machine, take a look at the comments at the top of the utils/NightlyTester.pl
434file. We usually run it from a crontab entry that looks ilke this:
435</p>
436
437<pre>
4385 3 * * * LLVM_LIB_SEARCH_PATH=.../llvm-gcc/bytecode-libs $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTRING... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
439</pre>
440
Reid Spencer8284f1f2004-09-05 20:07:26 +0000441<p>Or, you can create a shell script to encapsulate the running of the script.
442The optimized x86 Linux nightly test is run from just such a script:
443<pre>
444#!/bin/bash
445BASE=/proj/work/llvm/nightlytest
446export CVSROOT=:pserver:anon@llvm.cs.uiuc.edu:/var/cvs/llvm
447export BUILDDIR=$BASE/build
448export WEBDIR=$BASE/testresults
449export LLVMGCCDIR=/proj/work/llvm/cfrontend/install
450export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH
451export LD_LIBRARY_PATH=/proj/install/lib
452export LLVM_LIB_SEARCH_PATH=/proj/work/llvm/cfrontend/install/bytecode-libs
453cd $BASE
454cp /proj/work/llvm/llvm/utils/NightlyTest.pl .
455nice ./NightlyTest.pl -nice -release -verbose -parallel -enable-linscan -noexternals
456</pre>
457
Chris Lattnerfd9d1b32004-06-24 20:53:09 +0000458<p>
459Take a look at the NightlyTest.pl file to see what all of the flags and
460strings do. If you start running the nightly tests, please let us know and
461we'll link your page to the global tester page. Thanks!
462</p>
Misha Brukman1d83e112004-03-01 18:21:04 +0000463
464</div>
John Criswell020cbd82003-10-10 18:42:49 +0000465
Brian Gaekeaf19f2e2003-10-23 18:10:28 +0000466<!-- *********************************************************************** -->
John Criswell020cbd82003-10-10 18:42:49 +0000467
Misha Brukman1d83e112004-03-01 18:21:04 +0000468<hr>
469<address>
470 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
471 src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
472 <a href="http://validator.w3.org/check/referer"><img
473 src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +0000474
Misha Brukman1d83e112004-03-01 18:21:04 +0000475 John T. Criswell<br>
Reid Spencer8284f1f2004-09-05 20:07:26 +0000476 <a href="http://llvm.x10sys.com/rspencer">Modified By Reid Spencer</a><br/>
477 <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br/>
Misha Brukman1d83e112004-03-01 18:21:04 +0000478 Last modified: $Date$
479</address>
Brian Gaekeaf19f2e2003-10-23 18:10:28 +0000480</body>
John Criswell020cbd82003-10-10 18:42:49 +0000481</html>