From e1c4400a92b57ecf62abb892da2a8a0a3be43600 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 14 Feb 2014 11:00:07 +0000 Subject: Move shared configs for lit test suites to test/ and unittests/ directories git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201399 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/CMakeLists.txt | 3 +++ unittests/lit.common.unit.cfg | 30 ++++++++++++++++++++++++++++++ unittests/lit.common.unit.configured.in | 24 ++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 unittests/CMakeLists.txt create mode 100644 unittests/lit.common.unit.cfg create mode 100644 unittests/lit.common.unit.configured.in (limited to 'unittests') diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt new file mode 100644 index 000000000..fe2c39781 --- /dev/null +++ b/unittests/CMakeLists.txt @@ -0,0 +1,3 @@ +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.unit.configured.in + ${CMAKE_CURRENT_BINARY_DIR}/lit.common.unit.configured) diff --git a/unittests/lit.common.unit.cfg b/unittests/lit.common.unit.cfg new file mode 100644 index 000000000..2bd8f376f --- /dev/null +++ b/unittests/lit.common.unit.cfg @@ -0,0 +1,30 @@ +# -*- Python -*- + +# Configuration file for 'lit' test runner. +# This file contains common config setup rules for unit tests in various +# compiler-rt testsuites. + +import os + +import lit.formats + +# Setup test format +llvm_build_mode = getattr(config, "llvm_build_mode", "Debug") +config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test") + +# Setup test suffixes. +config.suffixes = [] + +# Tweak PATH to include llvm tools dir. +llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) +if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): + lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir) +path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) +config.environment['PATH'] = path + +# Propagate the temp directory. Windows requires this because it uses \Windows\ +# if none of these are present. +if 'TMP' in os.environ: + config.environment['TMP'] = os.environ['TMP'] +if 'TEMP' in os.environ: + config.environment['TEMP'] = os.environ['TEMP'] diff --git a/unittests/lit.common.unit.configured.in b/unittests/lit.common.unit.configured.in new file mode 100644 index 000000000..fe827c638 --- /dev/null +++ b/unittests/lit.common.unit.configured.in @@ -0,0 +1,24 @@ +## Autogenerated by LLVM/Clang configuration. +# Do not edit! + +# Generic config options for all compiler-rt unit tests. +config.target_triple = "@TARGET_TRIPLE@" +config.llvm_src_root = "@LLVM_SOURCE_DIR@" +config.llvm_obj_root = "@LLVM_BINARY_DIR@" +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@" +config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.host_arch = "@HOST_ARCH@" +config.host_os = "@HOST_OS@" + +# LLVM tools dir and build mode can be passed in lit parameters, +# so try to apply substitution. +try: + config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_build_mode = config.llvm_build_mode % lit_config.params +except KeyError,e: + key, = e.args + lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) + +# Setup attributes common for all compiler-rt unit tests. +lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/unittests/lit.common.unit.cfg") -- cgit v1.2.3