X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTestingGuide.html;h=d2c3bd06637a1463f31921e18b2a523a184ecdc5;hb=05ccd7039610c72b7fceb85a0c4b644aef2e64eb;hp=21e5ba8379b40604c671f987452129cdd68eaece;hpb=5026c7f91d23405fe3fc3d5d5618f2f1b9398299;p=oota-llvm.git diff --git a/docs/TestingGuide.html b/docs/TestingGuide.html index 21e5ba8379b..d2c3bd06637 100644 --- a/docs/TestingGuide.html +++ b/docs/TestingGuide.html @@ -23,7 +23,6 @@
  • LLVM Test Suite Tree
  • DejaGNU Structure
  • -
  • QMTest Structure
  • llvm-test Structure
  • Running the LLVM Tests
  • Running the nightly tester
  • @@ -60,18 +59,8 @@ required to build LLVM, plus the following:

    The Feature and Regressions tests are organized and run by DejaGNU.
    Expect
    Expect is required by DejaGNU.
    -
    tclsh
    -
    Tclsh is required by DejaGNU.
    - -
    QMTest
    -
    The LLVM test suite uses QMTest to organize and run tests. Note: -you will need QMTest -2.0.3 (source tar.gz file) to be successful. The tests do not run with -any other version. (optional, required only for QMTest)
    - -
    Python
    -
    You will need a Python interpreter that works with QMTest. Python will -need zlib and SAX support enabled. (optional, required only for QMTest)
    +
    tcl
    +
    Tcl is required by DejaGNU.
    F2C
    For now, LLVM does not have a Fortran front-end, but using F2C, we can run @@ -113,7 +102,7 @@ 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. Or you can do it manually.

    +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:

    @@ -123,29 +112,17 @@ or
     % gmake check
     
    -

    To run only a subdirectory of tests in llvm/test using DejaGNU (ie. Regression/Transforms). Just substitute the path to the subdirectory:

    -
    -% gmake -C llvm/test TESTSUITE=Regression/Transforms
    -
    -
    Note: If you are running the tests with objdir != subdir you must have run the complete testsuite before you can specify a subdirectory.
    -

    To run the simple tests (i.e. those that do basic testing of -LLVM), using QMTest:

    +

    To run only a subdirectory of tests in llvm/test using DejaGNU (ie. +Regression/Transforms), just set the TESTSUITE variable to the path of the +subdirectory (relative to llvm/test):

    -% gmake -C llvm/test qmtest
    -
    - -

    To run only the basic feature tests, QMTest supports the following -target:

    -
    -% gmake -C llvm/test Feature.t
    +% gmake -C llvm/test TESTSUITE=Regression/Transforms
     
    -

    To run only the regression tests, QMTest supports the following -target:

    -
    -% gmake -C llvm/test Regression.t
    -
    +

    Note: If you are running the tests with objdir != subdir, you +must have run the complete testsuite before you can specify a +subdirectory.

    To run the comprehensive test suite (tests that compile and execute whole programs), run the llvm-test tests:

    @@ -168,8 +145,8 @@ programs), run the llvm-test tests:

    The LLVM test suite contains two major categories of tests: code fragments and whole programs. Code fragments are in the llvm module -under the directory under the llvm/test directory. The whole programs -test suite are n the llvm-test module under the main directory.

    +under the llvm/test directory. The whole programs +test suite is in the llvm-test module under the main directory.

    @@ -270,11 +247,6 @@ directory are the SPEC 95 and SPEC 2000 benchmark suites. The presence and location of these external programs is configured by the llvm-test configure script.

    -
  • llvm/test/QMTest -

    This directory contains the QMTest information files. Inside this directory -are QMTest administration files and the Python code that implements the LLVM -test and database classes.

  • - @@ -285,12 +257,13 @@ test and database classes.

    The LLVM test suite is partially driven by DejaGNU and partially driven by GNU Make. Specifically, the Features and Regression tests -are all driven by DejaGNU (and optionally QMTest). The llvm-test +are all driven by DejaGNU. The llvm-test module is currently driven by a set of Makefiles.

    The DejaGNU structure is very simple, but does require some -information to be set. This information is gathered via configure and -is written to a file, site.exp in llvm/test. The llvm/test +information to be set. This information is gathered via configure and +is written to a file, site.exp in llvm/test. The +llvm/test Makefile does this work for you.

    In order for DejaGNU to work, each directory of tests must have a @@ -317,7 +290,8 @@ file:

    There are a couple patterns within a RUN line that the llvm-runtest procedure looks for and replaces with the appropriate syntax:

    -
      + +
      %p
      The path to the source directory. This is for locating any supporting files that are not generated by the test, but used by @@ -325,7 +299,7 @@ the test.
      %s
      The test file.
      -
      $t
      +
      %t
      Temporary filename: testscript.test_filename.tmp, where test_filename is the name of the test file. All temporary files are placed in the Output directory within the directory the test is @@ -335,9 +309,9 @@ located.
      Path to a script that performs grep -C. Use this since not all platforms support grep -C.
      -
      %llvmgcc
      Full path to the llvmgcc executable.
      -
      %llvmgxx
      Full path to the llvmg++ executable.
      -
    +
    %llvmgcc
    Full path to the llvm-gcc executable.
    +
    %llvmgxx
    Full path to the llvm-g++ executable.
    +

    There are also several scripts in the llvm/test/Scripts directory that you might find useful when writing RUN lines.

    @@ -355,78 +329,6 @@ machine. You can use * to match all targets. Here is an example of an
    - - - - -
    - -

    The Feature and Regression tests can also be run using QMTest.

    - -

    The QMTest system needs to have several pieces of information available; -these pieces of configuration information are known collectively as the -"context" in QMTest parlance. Since the context for LLVM is relatively large, -the master Makefile in llvm/test sets it for you.

    - -

    The LLVM database class makes the subdirectories of llvm/test a QMTest test -database. For each directory that contains tests driven by QMTest, it knows -what type of test the source file is and how to run it.

    - -

    Hence, the QMTest namespace is essentially what you see in the Feature and -Regression directories, but there is some magic that the database class performs -(as described below).

    - -

    The QMTest namespace is currently composed of the following tests and test -suites:

    - -
      -
    • Feature - -

      These are the feature tests found in the Feature directory. -They are broken up into the following categories:

      - -
        -
      • ad -

        Assembler/Disassembler tests. These tests verify that a piece of LLVM - assembly language can be assembled into bytecode and then disassembled - into the original assembly language code. It does this several times to - ensure that assembled output can be disassembled and disassembler output - can be assembled. It also verifies that the give assembly language file - can be assembled correctly.

      • - -
      • opt -

        Optimizer tests. These tests verify that two of the optimizer passes - completely optimize a program (i.e. after a single pass, they cannot - optimize a program any further).

      • - -
      • mc -

        Machine code tests. These tests verify that the LLVM assembly - language file can be translated into native assembly code.

      • - -
      • cc -

        C code tests. These tests verify that the specified LLVM assembly - code can be converted into C source code using the C backend.

      • -
      - -

      The LLVM database class looks at every file in the Feature directory and -creates a fake test hierarchy containing -Feature.<testtype>.<testname>. So, if you add an LLVM -assembly language file to the Feature directory, it actually creates 5 new -tests: assembler/disassembler, assembler, optimizer, machine code, and C code. -

    • - -
    • Regression -

      These are the regression tests. There is one suite for each - subdirectory of the Regression directory. If you add a new subdirectory - there, you will need to modify, at least, the RegressionMap - variable in QMTest/llvmdb.py so that QMTest knows how to run the - tests in the new subdirectory.

      -
    • - -
    - -
    - @@ -455,7 +357,33 @@ designed for internal LLVM research and will not work outside of the LLVM research group. They may still be valuable, however, as a guide to writing your own TEST Makefile for any optimization or analysis passes that you develop with LLVM.

    - + +

    Note, when configuring the llvm-test module, you might want to +specify the following configuration options:

    +
    +
    --enable-spec2000 +
    --enable-spec2000=<directory> +
    + Enable the use of SPEC2000 when testing LLVM. This is disabled by default + (unless configure finds SPEC2000 installed). By specifying + directory, you can tell configure where to find the SPEC2000 + benchmarks. If directory is left unspecified, configure + uses the default value + /home/vadve/shared/benchmarks/speccpu2000/benchspec. +

    +

    --enable-spec95 +
    --enable-spec95=<directory> +
    + Enable the use of SPEC95 when testing LLVM. It is similar to the + --enable-spec2000 option. +

    +

    --enable-povray +
    --enable-povray=<directory> +
    + Enable the use of Povray as an external test. Versions of Povray written + in C should work. This option is similar to the --enable-spec2000 + option. +
    @@ -468,18 +396,19 @@ LLVM.

    are not executed inside of the LLVM source tree. This is because the test suite creates temporary files during execution.

    -

    The master Makefile in llvm/test is capable of running only the QMTest driven +

    The master Makefile in llvm/test is capable of running only the DejaGNU driven tests. By default, it will run all of these tests.

    -

    To run only the QMTest driven tests, run gmake qmtest at the -command line in llvm/tests. To run a specific qmtest, suffix the test name with -".t" when running gmake.

    +

    To run only the DejaGNU driven tests, run gmake at the +command line in llvm/test. To run a specific directory of tests, use +the TESTSUITE variable. +

    -

    For example, to run the Regression.LLC tests, type -gmake Regression.LLC.t in llvm/tests.

    +

    For example, to run the Regression tests, type +gmake TESTSUITE=Regression in llvm/tests.

    Note that there are no Makefiles in llvm/test/Features and -llvm/test/Regression. You must use QMTest from the llvm/test +llvm/test/Regression. You must use DejaGNU from the llvm/test directory to run them.

    To run the llvm-test suite, you need to use the following steps: @@ -497,7 +426,7 @@ directory to run them.

    properly configured.
  • Use the configure script found in the llvm-test source directory:
    - $BUILD_SRC_DIR/configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT + $LLVM_SRC_ROOT/projects/llvm-test/configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT
  • gmake
  • @@ -521,11 +450,11 @@ output and standard error. You can redirect these results to a file if you choose.

    Some tests are known to fail. Some are bugs that we have not fixed yet; -others are features that we haven't added yet (or may never add). In QMTest, +others are features that we haven't added yet (or may never add). In DejaGNU, the result for such tests will be XFAIL (eXpected FAILure). In this way, you can tell the difference between an expected and unexpected failure.

    -

    The tests in llvm-test have no such feature as of this time. If the +

    The tests in llvm-test have no such feature at this time. If the test passes, only warnings and other miscellaneous output will be generated. If a test fails, a large <program> FAILED message will be displayed. This will help you separate benign warnings from actual test failures.

    @@ -545,18 +474,21 @@ 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: -

    +

    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:

    +
    -5 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
    +5 3 * * *  $HOME/llvm/utils/NightlyTest.pl -parallel $CVSROOT $HOME/buildtest-X86 $HOME/cvs/testresults-X86
     
    +

    Or, you can create a shell script to encapsulate the running of the script. -The optimized x86 Linux nightly test is run from just such a script: +The optimized x86 Linux nightly test is run from just such a script:

    + +
     #!/bin/bash
     BASE=/proj/work/llvm/nightlytest
    @@ -566,18 +498,17 @@ export WEBDIR=$BASE/testresults
     export LLVMGCCDIR=/proj/work/llvm/cfrontend/install
     export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH
     export LD_LIBRARY_PATH=/proj/install/lib
    -export LLVM_LIB_SEARCH_PATH=/proj/work/llvm/cfrontend/install/bytecode-libs
     cd $BASE
     cp /proj/work/llvm/llvm/utils/NightlyTest.pl .
    -nice ./NightlyTest.pl -nice -release -verbose -parallel -enable-linscan -noexternals
    +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
     
    +
    + +

    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!

    -

    -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! -

    - @@ -589,7 +520,7 @@ we'll link your page to the global tester page. Thanks! Valid HTML 4.01! - John T. Criswell
    + John T. Criswell, Reid Spencer, and Tanya Lattner
    The LLVM Compiler Infrastructure
    Last modified: $Date$