X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTestingGuide.html;h=f03adaaef64b0cdf326b27078e35114a473ceb88;hb=defb9fb4e9786443daac7e17d9d5dbe5d6f15098;hp=ac8e72bcb5e341c57111eb6c3970ec1dc5449b93;hpb=30c495e0f799d8ea2731d9c11a711a7ab7458410;p=oota-llvm.git diff --git a/docs/TestingGuide.html b/docs/TestingGuide.html index ac8e72bcb5e..f03adaaef64 100644 --- a/docs/TestingGuide.html +++ b/docs/TestingGuide.html @@ -24,7 +24,11 @@
  • LLVM Test Suite Tree
  • DejaGNU Structure
  • llvm-test Structure
  • -
  • Running the LLVM Tests
  • +
  • Running the LLVM Tests + +
  • Running the nightly tester
  • @@ -108,9 +112,10 @@ regression tests are in the main "llvm" module under the directory programs in C and C++ is in the llvm-test module. This module should be checked out to the llvm/projects directory. When you configure the llvm module, the llvm-test module -will be automatically configured. Alternatively, you can configure the llvm-test module manually.

    -

    To run all of the simple tests in LLVM using DejaGNU, use the master Makefile in the -llvm/test directory:

    +will be automatically configured. Alternatively, you can configure the + llvm-test module manually.

    +

    To run all of the simple tests in LLVM using DejaGNU, use the master Makefile + in the llvm/test directory:

     % gmake -C llvm/test
     
    @@ -156,8 +161,9 @@ test suite is in the llvm-test module under the main directory.

    -
    Code Fragments -
    + +
    Code Fragments
    +
    @@ -174,7 +180,9 @@ determine correct behavior.

    +
    Whole Programs
    +
    @@ -208,19 +216,27 @@ module.

    subtrees of the test suite directory tree are as follows:

    + +
    +Writing custom tests for llvm-test
    + + +
    + +

    Assuming you can run llvm-test, (e.g. "gmake TEST=nightly report" +should work), it is really easy to run optimizations or code generator +components against every program in the tree, collecting statistics or running +custom checks for correctness. At base, this is how the nightly tester works, +it's just one example of a general framework.

    + +

    Lets say that you have an LLVM optimization pass, and you want to see how +many times it triggers. First thing you should do is add an LLVM +statistic to your pass, which +will tally counts of things you care about.

    + +

    Following this, you can set up a test and a report that collects these and +formats them for easy viewing. This consists of two files, an +"llvm-test/TEST.XXX.Makefile" fragment (where XXX is the name of your +test) and an "llvm-test/TEST.XXX.report" file that indicates how to +format the output into a table. There are many example reports of various +levels of sophistication included with llvm-test, and the framework is very +general.

    + +

    If you are interested in testing an optimization pass, check out the +"libcalls" test as an example. It can be run like this:

    + +

    +
    +% cd llvm/projects/llvm-test/MultiSource/Benchmarks  # or some other level
    +% make TEST=libcalls report
    +
    +
    + +

    This will do a bunch of stuff, then eventually print a table like this:

    + +
    +
    +Name                                  | total | #exit |
    +...
    +FreeBench/analyzer/analyzer           | 51    | 6     | 
    +FreeBench/fourinarow/fourinarow       | 1     | 1     | 
    +FreeBench/neural/neural               | 19    | 9     | 
    +FreeBench/pifft/pifft                 | 5     | 3     | 
    +MallocBench/cfrac/cfrac               | 1     | *     | 
    +MallocBench/espresso/espresso         | 52    | 12    | 
    +MallocBench/gs/gs                     | 4     | *     | 
    +Prolangs-C/TimberWolfMC/timberwolfmc  | 302   | *     | 
    +Prolangs-C/agrep/agrep                | 33    | 12    | 
    +Prolangs-C/allroots/allroots          | *     | *     | 
    +Prolangs-C/assembler/assembler        | 47    | *     | 
    +Prolangs-C/bison/mybison              | 74    | *     | 
    +...
    +
    +
    + +

    This basically is grepping the -stats output and displaying it in a table. +You can also use the "TEST=libcalls report.html" target to get the table in HTML +form, similarly for report.csv and report.tex.

    + +

    The source for this is in llvm-test/TEST.libcalls.*. The format is pretty +simple: the Makefile indicates how to run the test (in this case, +"opt -simplify-libcalls -stats"), and the report contains one line for +each column of the output. The first value is the header for the column and the +second is the regex to grep the output of the command for. There are lots of +example reports that can do fancy stuff.

    + +
    + +
    Running the nightly tester
    @@ -474,20 +743,30 @@ will help you separate benign warnings from actual test failures.

    -The LLVM Nightly Testers +The LLVM Nightly Testers automatically check out an LLVM tree, build it, run the "nightly" -program test (described above), run all of the feature and regression tests, -and then delete the checked out tree. This tester is designed to ensure that -programs don't break as well as keep track of LLVM's progress over time.

    - -

    If you'd like to set up an instance of the nightly tester to run on your -machine, take a look at the comments at the top of the -utils/NightlyTester.pl file. We usually run it from a crontab entry -that looks ilke this:

    +program test (described above), run all of the feature and regression tests, +delete the checked out tree, and then submit the results to +http://llvm.org/nightlytest/. +After test results are submitted to +http://llvm.org/nightlytest/, +they are processed and displayed on the tests page. An email to + +llvm-testresults@cs.uiuc.edu summarizing the results is also generated. +This testing scheme is designed to ensure that programs don't break as well +as keep track of LLVM's progress over time.

    + +

    If you'd like to set up an instance of the nightly tester to run on your +machine, take a look at the comments at the top of the +utils/NewNightlyTest.pl file. If you decide to set up a nightly tester +please choose a unique nickname and invoke utils/NewNightlyTest.pl +with the "-nickname [yournickname]" command line option. We usually run it +from a crontab entry that looks like this:

    -5 3 * * *  $HOME/llvm/utils/NightlyTest.pl -parallel $CVSROOT $HOME/buildtest-X86 $HOME/cvs/testresults-X86
    +5 3 * * *  $HOME/llvm/utils/NewNightlyTest.pl -parallel -nickname Nickname \
    +           $CVSROOT $HOME/buildtest $HOME/cvs/testresults
     
    @@ -505,15 +784,24 @@ export LLVMGCCDIR=/proj/work/llvm/cfrontend/install export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH export LD_LIBRARY_PATH=/proj/install/lib cd $BASE -cp /proj/work/llvm/llvm/utils/NightlyTest.pl . -nice ./NightlyTest.pl -nice -release -verbose -parallel -enable-linscan -noexternals 2>&1 > output.log -mail -s 'X86 nightly tester results' llvm-testresults@cs.uiuc.edu < output.log +cp /proj/work/llvm/llvm/utils/NewNightlyTest.pl . +nice ./NewNightlyTest.pl -nice -release -verbose -parallel -enable-linscan \ + -nickname NightlyTester -noexternals 2>&1 > output.log
    -

    Take a look at the NightlyTest.pl file to see what all of the flags -and strings do. If you start running the nightly tests, please let us know and -we'll link your page to the global tester page. Thanks!

    +

    It is also possible to specify the the location your nightly test results +are submitted. You can do this by passing the command line option +"-submit-server [server_address]" and "-submit-script [script_on_server]" to +utils/NewNightlyTest.pl. For example, to submit to the llvm.org +nightly test results page, you would invoke the nightly test script with +"-submit-server llvm.org -submit-script /nightlytest/NightlyTestAccept.cgi". +If these options are not specified, the nightly test script sends the results +to the llvm.org nightly test results page.

    + +

    Take a look at the NewNightlyTest.pl file to see what all of the +flags and strings do. If you start running the nightly tests, please let us +know. Thanks!