This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rGd02fb002dd6b: [lldb/Test] Make substrs argument to self.expect ordered. (authored by JDevlieghere).
Changed prior to commit: https://reviews.llvm.org/D73766?vs=241637&id=241801#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73766/new/ https://reviews.llvm.org/D73766 Files: lldb/packages/Python/lldbsuite/test/lldbtest.py Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -2341,8 +2341,11 @@ # Look for sub strings, if specified. keepgoing = matched if matching else not matched if substrs and keepgoing: + start = 0 for substr in substrs: - matched = output.find(substr) != -1 + index = output[start:].find(substr) + start = start + index if matching else 0 + matched = index != -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)
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -2341,8 +2341,11 @@ # Look for sub strings, if specified. keepgoing = matched if matching else not matched if substrs and keepgoing: + start = 0 for substr in substrs: - matched = output.find(substr) != -1 + index = output[start:].find(substr) + start = start + index if matching else 0 + matched = index != -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)
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits