[Lldb-commits] [lldb] r227938 - Add an expectall() API that allows you to pass a list of patterns and have pexpect match *ALL* of them instead of just picking one

Zachary Turner zturner at google.com
Mon Feb 2 19:30:21 PST 2015


Should the timeout be 0 on all iterations after the first?
On Mon, Feb 2, 2015 at 7:14 PM Enrico Granata <egranata at apple.com> wrote:

> Author: enrico
> Date: Mon Feb  2 21:11:59 2015
> New Revision: 227938
>
> URL: http://llvm.org/viewvc/llvm-project?rev=227938&view=rev
> Log:
> Add an expectall() API that allows you to pass a list of patterns and have
> pexpect match *ALL* of them instead of just picking one
>
> Modified:
>     lldb/trunk/test/lldbpexpect.py
>
> Modified: lldb/trunk/test/lldbpexpect.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/
> lldbpexpect.py?rev=227938&r1=227937&r2=227938&view=diff
> ============================================================
> ==================
> --- lldb/trunk/test/lldbpexpect.py (original)
> +++ lldb/trunk/test/lldbpexpect.py Mon Feb  2 21:11:59 2015
> @@ -32,6 +32,13 @@ class PExpectTest(TestBase):
>          else:
>              return self.child.expect(patterns, timeout=timeout)
>
> +    def expectall(self, patterns=None, timeout=None, exact=None):
> +        if patterns is None: return None
> +        if timeout is None: timeout = self.timeout
> +        if exact is None: exact = False
> +        for pattern in patterns:
> +            self.expect(pattern, timeout=timeout, exact=exact)
> +
>      def sendimpl(self, sender, command, patterns=None, timeout=None,
> exact=None):
>          sender(command)
>          return self.expect(patterns=patterns, timeout=timeout,
> exact=exact)
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150203/8a4d5e10/attachment.html>


More information about the lldb-commits mailing list