]> granicus.if.org Git - clang/commitdiff
test/Unit: Fixup lit.cfg to allow running inside test/Unit (with llvm-config in
authorDaniel Dunbar <daniel@zuster.org>
Wed, 22 Jun 2011 21:46:43 +0000 (21:46 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 22 Jun 2011 21:46:43 +0000 (21:46 +0000)
path).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133653 91177308-0d34-0410-b5e6-96231b3b80d8

test/Unit/lit.cfg

index 794234ce5575795cf165751af1149a6f71affa0b..8f27781523f0eecb7b69c065aed0c6a38551264f 100644 (file)
@@ -30,14 +30,6 @@ if 'TEMP' in os.environ:
 
 ###
 
-# If necessary, point the dynamic loader at libLLVM.so.
-if config.enable_shared:
-    shlibpath = config.environment.get(config.shlibpath_var,'')
-    if shlibpath:
-        shlibpath = os.pathsep + shlibpath
-    shlibpath = config.shlibdir + shlibpath
-    config.environment[config.shlibpath_var] = shlibpath
-
 # Check that the object root is known.
 if config.test_exec_root is None:
     # Otherwise, we haven't loaded the site specific configuration (the user is
@@ -71,7 +63,7 @@ if config.test_exec_root is None:
 
     # Validate that we got a tree which points to here, using the standard
     # tools/clang layout.
-    this_src_root = os.path.dirname(config.test_source_root)
+    this_src_root = os.path.join(os.path.dirname(__file__),'..','..')
     if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
         lit.fatal('No site specific configuration available!')
 
@@ -84,3 +76,11 @@ if config.test_exec_root is None:
     lit.note('using out-of-tree build at %r' % clang_obj_root)
     lit.load_config(config, site_cfg)
     raise SystemExit
+
+# If necessary, point the dynamic loader at libLLVM.so.
+if config.enable_shared:
+    shlibpath = config.environment.get(config.shlibpath_var,'')
+    if shlibpath:
+        shlibpath = os.pathsep + shlibpath
+    shlibpath = config.shlibdir + shlibpath
+    config.environment[config.shlibpath_var] = shlibpath