summaryrefslogtreecommitdiffstats
path: root/compiler-rt/unittests
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-02-14 11:00:07 +0000
committerAlexey Samsonov <samsonov@google.com>2014-02-14 11:00:07 +0000
commit81a2b466e916ca6b38e1d98eae8c556d317b70ef (patch)
tree371fb85c0a33baa13158fd1f82df24f389f73143 /compiler-rt/unittests
parent31eb03f817f68f6231c6026a4a12c85ddd0ea9b5 (diff)
downloadbcm5719-llvm-81a2b466e916ca6b38e1d98eae8c556d317b70ef.tar.gz
bcm5719-llvm-81a2b466e916ca6b38e1d98eae8c556d317b70ef.zip
Move shared configs for lit test suites to test/ and unittests/ directories
llvm-svn: 201399
Diffstat (limited to 'compiler-rt/unittests')
-rw-r--r--compiler-rt/unittests/CMakeLists.txt3
-rw-r--r--compiler-rt/unittests/lit.common.unit.cfg30
-rw-r--r--compiler-rt/unittests/lit.common.unit.configured.in24
3 files changed, 57 insertions, 0 deletions
diff --git a/compiler-rt/unittests/CMakeLists.txt b/compiler-rt/unittests/CMakeLists.txt
new file mode 100644
index 00000000000..fe2c39781a9
--- /dev/null
+++ b/compiler-rt/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/compiler-rt/unittests/lit.common.unit.cfg b/compiler-rt/unittests/lit.common.unit.cfg
new file mode 100644
index 00000000000..2bd8f376f00
--- /dev/null
+++ b/compiler-rt/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/compiler-rt/unittests/lit.common.unit.configured.in b/compiler-rt/unittests/lit.common.unit.configured.in
new file mode 100644
index 00000000000..fe827c638be
--- /dev/null
+++ b/compiler-rt/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")
OpenPOWER on IntegriCloud