[clang-tools-extra] r215543 - Also run extra tools unit tests in shared library builds.
Benjamin Kramer
benny.kra at googlemail.com
Wed Aug 13 05:54:50 PDT 2014
Author: d0k
Date: Wed Aug 13 07:54:50 2014
New Revision: 215543
URL: http://llvm.org/viewvc/llvm-project?rev=215543&view=rev
Log:
Also run extra tools unit tests in shared library builds.
Took me way too long to figure out why they didn't run.
Modified:
clang-tools-extra/trunk/test/Unit/lit.cfg
clang-tools-extra/trunk/test/Unit/lit.site.cfg.in
Modified: clang-tools-extra/trunk/test/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/Unit/lit.cfg?rev=215543&r1=215542&r2=215543&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/Unit/lit.cfg (original)
+++ clang-tools-extra/trunk/test/Unit/lit.cfg Wed Aug 13 07:54:50 2014
@@ -1,5 +1,7 @@
# -*- Python -*-
+import platform
+
import lit.formats
config.name = "Extra Tools Unit Tests"
@@ -12,11 +14,6 @@ if extra_tools_obj_dir is not None:
config.test_source_root = extra_tools_obj_dir
config.test_exec_root = config.test_source_root
-# Win32 seeks DLLs along %PATH%.
-if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
- config.environment['PATH'] = os.path.pathsep.join((
- config.shlibdir, config.environment['PATH']))
-
# All GoogleTests are named to have 'Tests' as their suffix. The '.' option is
# a special value for GoogleTest indicating that it should look through the
# entire testsuite recursively for tests (alternatively, one could provide a
@@ -34,3 +31,24 @@ if config.test_exec_root is None:
raise SystemExit
# FIXME: Support out-of-tree builds? See clang/test/Unit/lit.cfg if we care.
+
+shlibpath_var = ''
+if platform.system() == 'Linux':
+ shlibpath_var = 'LD_LIBRARY_PATH'
+elif platform.system() == 'Darwin':
+ shlibpath_var = 'DYLD_LIBRARY_PATH'
+elif platform.system() == 'Windows':
+ shlibpath_var = 'PATH'
+
+# Point the dynamic loader at dynamic libraries in 'lib'.
+llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
+if not llvm_libs_dir:
+ lit_config.fatal('No LLVM libs dir set!')
+shlibpath = os.path.pathsep.join((llvm_libs_dir,
+ config.environment.get(shlibpath_var,'')))
+
+# Win32 seeks DLLs along %PATH%.
+if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
+ shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
+
+config.environment[shlibpath_var] = shlibpath
Modified: clang-tools-extra/trunk/test/Unit/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/Unit/lit.site.cfg.in?rev=215543&r1=215542&r2=215543&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/Unit/lit.site.cfg.in (original)
+++ clang-tools-extra/trunk/test/Unit/lit.site.cfg.in Wed Aug 13 07:54:50 2014
@@ -2,6 +2,7 @@
# Do not edit!
config.extra_tools_obj_dir = "@CLANG_TOOLS_BINARY_DIR@/unittests"
config.extra_tools_src_dir = "@CLANG_TOOLS_SOURCE_DIR@/unittests"
+config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.shlibdir = "@SHLIBDIR@"
config.target_triple = "@TARGET_TRIPLE@"
More information about the cfe-commits
mailing list