================
@@ -1102,3 +1103,28 @@ def is_feature_enabled():
                 return "%s is not supported on this system." % feature
 
     return skipTestIfFn(is_feature_enabled)
+
+
+def skipIfBinaryToLarge(path: Optional[str], maxSize: int):
+    """Skip the test if a binary is to large.
+
+    We skip this test for debug builds because it takes too long
+    parsing lldb's own debug info. Release builds are fine.
+    Checking the size of the lldb-dap binary seems to be a decent
+    proxy for a quick detection. It should be far less than 1 MB in
+    Release builds.
+    """
+
+    def check_binary_size():
+        if not path or not os.path.exists(path):
+            return "invalid path"
+
+        try:
+            size = os.path.getsize(path)
+            if size <= maxSize:
+                return None
+            return f"binary {path} (size = {size} is to larger than {maxSize}"
+        except:
+            return f"failed to read size of {path}"
+
+    return skipTestIfFn(check_binary_size)
----------------
JDevlieghere wrote:

This feels a little bit too ad-hoc. How about `@skipIfDebugBuild`? CMake knows 
if we're in a debug build and could configure lit, which in turn could tell 
detest. That seems like a more general solution to this particular problem. 

https://github.com/llvm/llvm-project/pull/140777
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to