Fix TestPaths.py on windows

I committed an implementation of GetClangResourceDir on windows but
forgot to update this test. I merged the tests like I intended to, but I
realized that the test was actually failing. After looking into it, it
appears that FileSystem::Resolve was taking the path and setting
the FileSpec's Directory to "/path/to/lldb/lib/clang/" and the File to
"9.0.0" which isn't what we want. So I removed the resolve line from
DefaultComputeClangResourceDir.

llvm-svn: 355648
This commit is contained in:
Alex Langford 2019-03-07 22:37:23 +00:00
parent 46fac9c4f2
commit d672e533d5
2 changed files with 2 additions and 11 deletions

View File

@ -25,22 +25,14 @@ class TestPaths(TestBase):
lldb.ePathTypePythonDir, lldb.ePathTypePythonDir,
lldb.ePathTypeLLDBSystemPlugins, lldb.ePathTypeLLDBSystemPlugins,
lldb.ePathTypeLLDBUserPlugins, lldb.ePathTypeLLDBUserPlugins,
lldb.ePathTypeLLDBTempSystemDir] lldb.ePathTypeLLDBTempSystemDir,
lldb.ePathTypeClangDir]
for path_type in dir_path_types: for path_type in dir_path_types:
f = lldb.SBHostOS.GetLLDBPath(path_type) f = lldb.SBHostOS.GetLLDBPath(path_type)
# No directory path types should have the filename set # No directory path types should have the filename set
self.assertTrue(f.GetFilename() is None) self.assertTrue(f.GetFilename() is None)
# TODO: Merge into test_path when GetClangResourceDir is implemented on
# windows
@expectedFailureAll(oslist=["windows"])
@no_debug_info_test
def test_clang_dir_path(self):
'''Test to make sure clang dir is set correctly'''
clang_dir = lldb.SBHostOS.GetLLDBPath(lldb.ePathTypeClangDir)
self.assertFalse(clang_dir.GetDirectory() is None)
@no_debug_info_test @no_debug_info_test
def test_directory_doesnt_end_with_slash(self): def test_directory_doesnt_end_with_slash(self):
current_directory_spec = lldb.SBFileSpec(os.path.curdir) current_directory_spec = lldb.SBFileSpec(os.path.curdir)

View File

@ -54,7 +54,6 @@ static bool DefaultComputeClangResourceDirectory(FileSpec &lldb_shlib_spec,
llvm::sys::path::append(clang_dir, relative_path); llvm::sys::path::append(clang_dir, relative_path);
if (!verify || VerifyClangPath(clang_dir)) { if (!verify || VerifyClangPath(clang_dir)) {
file_spec.GetDirectory().SetString(clang_dir); file_spec.GetDirectory().SetString(clang_dir);
FileSystem::Instance().Resolve(file_spec);
return true; return true;
} }