================
@@ -914,6 +914,25 @@ def checkForkVForkSupport():
         configuration.skip_categories.append("fork")
 
 
+def checkPexpectSupport():
+    from lldbsuite.test import lldbplatformutil
+
+    platform = lldbplatformutil.getPlatform()
+
+    # llvm.org/pr22274: need a pexpect replacement for windows
+    if platform in ["windows"]:
+        if configuration.verbose:
+            print("pexpect tests will be skipped because of unsupported 
platform")
+        configuration.skip_categories.append("pexpect")
+    elif not configuration.shouldSkipBecauseOfCategories(["pexpect"]):
+        try:
+            import pexpect
+        except:
+            print(
+                "Warning: pexpect is not installed, but pexpect tests are not 
being skipped."
----------------
rupprecht wrote:

Note: instead of just printing a warning, we could make this also add `pexpect` 
to `skip_categories` as above. However, that would lead to a false notion that 
`pexpect` tests are running and passing. Someone who is running these tests may 
not be aware that `pexpect` needs to be installed, or maybe they are aware but 
a system change made them go away. IMHO, it is safer to let the tests fail and 
make the user acknowledge that `pexpect` tests should be skipped.

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

Reply via email to