Fix test suite lookup path for LLDB.h
authorChris Bieneman <beanz@apple.com>
Wed, 12 Oct 2016 20:22:02 +0000 (20:22 +0000)
committerChris Bieneman <beanz@apple.com>
Wed, 12 Oct 2016 20:22:02 +0000 (20:22 +0000)
Summary:
When running on Darwin, the test suite assumes a specific directory structure for the build directory. This works for the Xcode project builds, but fails for CMake builds regardless of whether or not you are generating the LLDB framework.

This patch allows the Darwin code path to fall back to the more generic code path used by other platforms in the event that LLDB.h isn't where the test suite expects it.

This allows API tests to run on Darwin when building with CMake with the framework build enabled or disabled.

Reviewers: tfiala, zturner

Subscribers: labath, lldb-commits

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

llvm-svn: 284043

lldb/packages/Python/lldbsuite/test/decorators.py

index ceb9f52..805c707 100644 (file)
@@ -512,13 +512,15 @@ def skipIfNoSBHeaders(func):
                 'Current',
                 'Headers',
                 'LLDB.h')
-        else:
-            header = os.path.join(
-                os.environ["LLDB_SRC"],
-                "include",
-                "lldb",
-                "API",
-                "LLDB.h")
+            if os.path.exists(header):
+                return None
+        
+        header = os.path.join(
+            os.environ["LLDB_SRC"],
+            "include",
+            "lldb",
+            "API",
+            "LLDB.h")
         if not os.path.exists(header):
             return "skip because LLDB.h header not found"
         return None