[lld] r187005 - Add lit magic so that lld unittests are run as part of lld test suite

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Jul 26 07:21:36 PDT 2013


Thanks!

On 23 July 2013 19:42, Nick Kledzik <kledzik at apple.com> wrote:
> Author: kledzik
> Date: Tue Jul 23 18:42:17 2013
> New Revision: 187005
>
> URL: http://llvm.org/viewvc/llvm-project?rev=187005&view=rev
> Log:
> Add lit magic so that lld unittests are run as part of lld test suite
>
> Added:
>     lld/trunk/test/Unit/
>     lld/trunk/test/Unit/lit.cfg
>     lld/trunk/test/Unit/lit.site.cfg.in
> Modified:
>     lld/trunk/test/CMakeLists.txt
>
> Modified: lld/trunk/test/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/CMakeLists.txt?rev=187005&r1=187004&r2=187005&view=diff
> ==============================================================================
> --- lld/trunk/test/CMakeLists.txt (original)
> +++ lld/trunk/test/CMakeLists.txt Tue Jul 23 18:42:17 2013
> @@ -14,6 +14,10 @@ endif(BUILD_SHARED_LIBS)
>  configure_lit_site_cfg(
>    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
>    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
> +configure_lit_site_cfg(
> +  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
> +  ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
> +  )
>
>  if ( NOT LLD_BUILT_STANDALONE )
>
> @@ -28,9 +32,10 @@ if ( NOT LLD_BUILT_STANDALONE )
>      lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
>      )
>
> -  add_lit_testsuite(check-lld "Running lld regression tests"
> +  add_lit_testsuite(check-lld "Running lld test suite"
>      ${CMAKE_CURRENT_BINARY_DIR}
> -    PARAMS ${LLD_TEST_PARAMS}
> +    PARAMS lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
> +         lld_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
>      DEPENDS ${LLD_TEST_DEPS}
>      )
>
>
> Added: lld/trunk/test/Unit/lit.cfg
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Unit/lit.cfg?rev=187005&view=auto
> ==============================================================================
> --- lld/trunk/test/Unit/lit.cfg (added)
> +++ lld/trunk/test/Unit/lit.cfg Tue Jul 23 18:42:17 2013
> @@ -0,0 +1,21 @@
> +# -*- Python -*-
> +
> +# Configuration file for the 'lit' test runner.
> +
> +import os
> +
> +# name: The name of this test suite.
> +config.name = 'lld-Unit'
> +
> +# suffixes: A list of file extensions to treat as test files.
> +config.suffixes =  []
> +
> +# test_source_root: The root path where unit test binaries are located.
> +# test_exec_root: The root path where tests should be run.
> +config.test_source_root = os.path.join(config.lld_obj_root, 'unittests')
> +config.test_exec_root = config.test_source_root
> +
> +# testFormat: The test format to use to interpret tests.
> +if not hasattr(config, 'llvm_build_mode'):
> +    lit.fatal("unable to find llvm_build_mode value on config")
> +config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests')
>
> Added: lld/trunk/test/Unit/lit.site.cfg.in
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Unit/lit.site.cfg.in?rev=187005&view=auto
> ==============================================================================
> --- lld/trunk/test/Unit/lit.site.cfg.in (added)
> +++ lld/trunk/test/Unit/lit.site.cfg.in Tue Jul 23 18:42:17 2013
> @@ -0,0 +1,25 @@
> +## Autogenerated by LLVM/lld configuration.
> +# Do not edit!
> +config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> +config.llvm_obj_root = "@LLVM_BINARY_DIR@"
> +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> +config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
> +config.llvm_build_mode = "@LLVM_BUILD_MODE@"
> +config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
> +config.lld_obj_root = "@LLD_BINARY_DIR@"
> +config.lld_src_root = "@LLD_SOURCE_DIR@"
> +config.target_triple = "@TARGET_TRIPLE@"
> +config.python_executable = "@PYTHON_EXECUTABLE@"
> +
> +# Support substitution of the tools and libs dirs with user parameters. This is
> +# used when we can't determine the tool dir at configuration time.
> +try:
> +    config.llvm_tools_dir = config.llvm_tools_dir % lit.params
> +    config.llvm_libs_dir = config.llvm_libs_dir % lit.params
> +    config.llvm_build_mode = config.llvm_build_mode % lit.params
> +except KeyError,e:
> +    key, = e.args
> +    lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
> +
> +# Let the main config do the real work.
> +lit.load_config(config, "@LLD_SOURCE_DIR@/test/Unit/lit.cfg")
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list