Fix TestPaths.py on windows
authorAlex Langford <apl@fb.com>
Thu, 7 Mar 2019 22:37:23 +0000 (22:37 +0000)
committerAlex Langford <apl@fb.com>
Thu, 7 Mar 2019 22:37:23 +0000 (22:37 +0000)
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

lldb/packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp

index 96e1446c2787d0f316f26ad5c80c858592c20c63..816751cd8795c2bd6df6fe7ade6e4d8598b98230 100644 (file)
@@ -25,22 +25,14 @@ class TestPaths(TestBase):
                           lldb.ePathTypePythonDir,
                           lldb.ePathTypeLLDBSystemPlugins,
                           lldb.ePathTypeLLDBUserPlugins,
-                          lldb.ePathTypeLLDBTempSystemDir]
+                          lldb.ePathTypeLLDBTempSystemDir,
+                          lldb.ePathTypeClangDir]
 
         for path_type in dir_path_types:
             f = lldb.SBHostOS.GetLLDBPath(path_type)
             # No directory path types should have the filename set
             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
     def test_directory_doesnt_end_with_slash(self):
         current_directory_spec = lldb.SBFileSpec(os.path.curdir)
index ce0b630225fb0304dd8db02854655793caf15eef..392baecb3054c5ccd05d77fc868a74e85fabf7c8 100644 (file)
@@ -54,7 +54,6 @@ static bool DefaultComputeClangResourceDirectory(FileSpec &lldb_shlib_spec,
   llvm::sys::path::append(clang_dir, relative_path);
   if (!verify || VerifyClangPath(clang_dir)) {
     file_spec.GetDirectory().SetString(clang_dir);
-    FileSystem::Instance().Resolve(file_spec);
     return true;
   }