[Lldb-commits] [lldb] 6f2a4c4 - Revert "[lldb/Test] Make substrs argument to self.expect ordered."

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 31 13:50:48 PST 2020


Author: Jonas Devlieghere
Date: 2020-01-31T13:50:39-08:00
New Revision: 6f2a4c424e14e2564c64450d9416036ebe97b260

URL: https://github.com/llvm/llvm-project/commit/6f2a4c424e14e2564c64450d9416036ebe97b260
DIFF: https://github.com/llvm/llvm-project/commit/6f2a4c424e14e2564c64450d9416036ebe97b260.diff

LOG: Revert "[lldb/Test] Make substrs argument to self.expect ordered."

Temporarily revert to fix the tests that only fail on the bots because
of the newly enforced substr order.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbtest.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 933a99d5e142..602749c80fa8 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2341,11 +2341,8 @@ def expect(
         # Look for sub strings, if specified.
         keepgoing = matched if matching else not matched
         if substrs and keepgoing:
-            start = 0
             for substr in substrs:
-                index = output[start:].find(substr)
-                start = start + index if matching else 0
-                matched = index != -1
+                matched = output.find(substr) != -1
                 with recording(self, trace) as sbuf:
                     print("%s sub string: %s" % (heading, substr), file=sbuf)
                     print("Matched" if matched else "Not matched", file=sbuf)


        


More information about the lldb-commits mailing list