Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
[libunwind] [test] Fix inferring source paths
Browse files Browse the repository at this point in the history
Fix two issues that caused libcxx source path not to be inferred
correctly when not specified explicitly:

1. get_lit_conf() uses default value only if the lit variable is set
   to None.  Due to the mehod of substituting lit.site.cfg, they were
   "" rather than None when unset, effectively causing the default never
   to apply.  Instead, use 'or' construct to use the default whenever
   get_lit_conf() returns a false value.

2. If os.path.join() is given a component starting with '/', it takes
   it to be an absolute path and ignores everything preceding it.
   Remove the slash to correctly append subdirectory.

With these two fixes, libunwind tests start working on NetBSD buildbot
again.

Differential Revision: https://reviews.llvm.org/D62005

git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@361931 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mgorny committed May 29, 2019
1 parent a822c5b commit 4843fb2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/libunwind/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ def __init__(self, lit_config, config):
self.libcxx_src_root = None

def configure_src_root(self):
self.libunwind_src_root = self.get_lit_conf(
'libunwind_src_root',
os.path.dirname(self.config.test_source_root))
self.libcxx_src_root = self.get_lit_conf(
'libcxx_src_root',
os.path.join(self.libunwind_src_root, '/../libcxx'))
self.libunwind_src_root = (self.get_lit_conf('libunwind_src_root')
or os.path.dirname(self.config.test_source_root))
self.libcxx_src_root = (self.get_lit_conf('libcxx_src_root')
or os.path.join(self.libunwind_src_root, '..', 'libcxx'))

def configure_obj_root(self):
self.libunwind_obj_root = self.get_lit_conf('libunwind_obj_root')
Expand Down

0 comments on commit 4843fb2

Please sign in to comment.