Skip to content

Commit a60a269

Browse files
committed
test/Unit: Fixup lit.cfg to allow running inside test/Unit (with llvm-config in
path). llvm-svn: 133653
1 parent bfae99c commit a60a269

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

clang/test/Unit/lit.cfg

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ if 'TEMP' in os.environ:
3030

3131
###
3232

33-
# If necessary, point the dynamic loader at libLLVM.so.
34-
if config.enable_shared:
35-
shlibpath = config.environment.get(config.shlibpath_var,'')
36-
if shlibpath:
37-
shlibpath = os.pathsep + shlibpath
38-
shlibpath = config.shlibdir + shlibpath
39-
config.environment[config.shlibpath_var] = shlibpath
40-
4133
# Check that the object root is known.
4234
if config.test_exec_root is None:
4335
# Otherwise, we haven't loaded the site specific configuration (the user is
@@ -71,7 +63,7 @@ if config.test_exec_root is None:
7163

7264
# Validate that we got a tree which points to here, using the standard
7365
# tools/clang layout.
74-
this_src_root = os.path.dirname(config.test_source_root)
66+
this_src_root = os.path.join(os.path.dirname(__file__),'..','..')
7567
if os.path.realpath(clang_src_root) != os.path.realpath(this_src_root):
7668
lit.fatal('No site specific configuration available!')
7769

@@ -84,3 +76,11 @@ if config.test_exec_root is None:
8476
lit.note('using out-of-tree build at %r' % clang_obj_root)
8577
lit.load_config(config, site_cfg)
8678
raise SystemExit
79+
80+
# If necessary, point the dynamic loader at libLLVM.so.
81+
if config.enable_shared:
82+
shlibpath = config.environment.get(config.shlibpath_var,'')
83+
if shlibpath:
84+
shlibpath = os.pathsep + shlibpath
85+
shlibpath = config.shlibdir + shlibpath
86+
config.environment[config.shlibpath_var] = shlibpath

0 commit comments

Comments
 (0)