X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTestingGuide.rst;h=adf5f3d4cfbde11f715ecc87ebffb2bcfd849878;hb=3b50e969941556504036a65415d95d1b0ad45ee3;hp=f9222372c2afd6c5bc9bd622d74f024d60a06643;hpb=4b3ec1763c22130fb91380413a8c3ddbdf044c3e;p=oota-llvm.git diff --git a/docs/TestingGuide.rst b/docs/TestingGuide.rst index f9222372c2a..adf5f3d4cfb 100644 --- a/docs/TestingGuide.rst +++ b/docs/TestingGuide.rst @@ -22,7 +22,7 @@ Requirements ============ In order to use the LLVM testing infrastructure, you will need all of the -software required to build LLVM, as well as `Python `_ 2.5 or +software required to build LLVM, as well as `Python `_ 2.7 or later. LLVM testing infrastructure organization @@ -240,6 +240,58 @@ The recommended way to examine output to figure out if the test passes is using the :doc:`FileCheck tool `. *[The usage of grep in RUN lines is deprecated - please do not send or commit patches that use it.]* +Extra files +----------- + +If your test requires extra files besides the file containing the ``RUN:`` +lines, the idiomatic place to put them is in a subdirectory ``Inputs``. +You can then refer to the extra files as ``%S/Inputs/foo.bar``. + +For example, consider ``test/Linker/ident.ll``. The directory structure is +as follows:: + + test/ + Linker/ + ident.ll + Inputs/ + ident.a.ll + ident.b.ll + +For convenience, these are the contents: + +.. code-block:: llvm + + ;;;;; ident.ll: + + ; RUN: llvm-link %S/Inputs/ident.a.ll %S/Inputs/ident.b.ll -S | FileCheck %s + + ; Verify that multiple input llvm.ident metadata are linked together. + + ; CHECK-DAG: !llvm.ident = !{!0, !1, !2} + ; CHECK-DAG: "Compiler V1" + ; CHECK-DAG: "Compiler V2" + ; CHECK-DAG: "Compiler V3" + + ;;;;; Inputs/ident.a.ll: + + !llvm.ident = !{!0, !1} + !0 = metadata !{metadata !"Compiler V1"} + !1 = metadata !{metadata !"Compiler V2"} + + ;;;;; Inputs/ident.b.ll: + + !llvm.ident = !{!0} + !0 = metadata !{metadata !"Compiler V3"} + +For symmetry reasons, ``ident.ll`` is just a dummy file that doesn't +actually participate in the test besides holding the ``RUN:`` lines. + +.. note:: + + Some existing tests use ``RUN: true`` in extra files instead of just + putting the extra files in an ``Inputs/`` directory. This pattern is + deprecated. + Fragile tests ------------- @@ -304,8 +356,7 @@ For instance, on ``test/CodeGen/ARM``, the ``lit.local.cfg`` is: .. code-block:: python config.suffixes = ['.ll', '.c', '.cpp', '.test'] - targets = set(config.root.targets_to_build.split()) - if not 'ARM' in targets: + if not 'ARM' in config.root.targets: config.unsupported = True Other platform-specific tests are those that depend on a specific feature @@ -422,6 +473,25 @@ RUN lines: To add more substituations, look at ``test/lit.cfg`` or ``lit.local.cfg``. +Options +------- + +The llvm lit configuration allows to customize some things with user options: + +``llc``, ``opt``, ... + Substitute the respective llvm tool name with a custom command line. This + allows to specify custom paths and default arguments for these tools. + Example: + + % llvm-lit "-Dllc=llc -verify-machineinstrs" + +``run_long_tests`` + Enable the execution of long running tests. + +``llvm_site_config`` + Load the specified lit configuration instead of the default one. + + Other Features --------------