[Lldb-commits] [PATCH] D58748: [ExpressionParser] Test GetClangResourceDir

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 27 16:13:55 PST 2019


xiaobai created this revision.
xiaobai added reviewers: zturner, clayborg.
Herald added subscribers: jdoerfert, kadircet, ioeric, ilya-biryukov.
Herald added a reviewer: serge-sans-paille.

I'm doing this because I plan on implementing `ComputeClangDirectory` on windows
so that `GetClangResourceDir` will work.  Additionally, I made
test_paths make sure that the directory member of the returned FileSpec is not
none. This will fail on windows since `ComputeClangDirectory` isn't implemented
yet.


https://reviews.llvm.org/D58748

Files:
  packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py


Index: packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
+++ packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
@@ -16,6 +16,8 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
+    # GetClangResourceDir doesn't work on windows yet
+    @expectedFailureAll(oslist=["windows"])
     @no_debug_info_test
     def test_paths(self):
         '''Test to make sure no file names are set in the lldb.SBFileSpec objects returned by lldb.SBHostOS.GetLLDBPath() for paths that are directories'''
@@ -25,12 +27,15 @@
                           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)
+            # All directory path types should have the directory set
+            self.assertFalse(f.GetDirectory() is None)
 
     @no_debug_info_test
     def test_directory_doesnt_end_with_slash(self):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58748.188644.patch
Type: text/x-patch
Size: 1445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190228/38749296/attachment.bin>


More information about the lldb-commits mailing list