This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] [TAKE 3] Testcase For str_replace()


On Thursday 18 Jun 2009 8:34:20 pm Frank Ch. Eigler wrote:
> Varun Chandramohan <varunc@linux.vnet.ibm.com> writes:
> > This patch adds the test case needed for this function. [...]
> > +spawn stap -DMAXERRORS=2 $srcdir/$subdir/$test.stp
> > +expect {
> > +   -timeout 15
> > +   -re {ERROR: Invalid Search String} { incr ko; exp_continue }
> > +   -re {WARNING: Number of errors} { incr ko ; exp_continue }
> > +   -re {Result = hello pointer tap} { incr ok ; exp_continue }
> > +   -re {Result = pointer system tap} { incr ok ; exp_continue }
> > +   -re {Result = hello system pointer} { incr ok ; exp_continue }
> > [...]
>
> One nit: your search strings are not regular expressions, so you
> wouldn't normally use "-re" there.
>
> However, I've had cases where I had to use -re anyway, forcing precise
> line-begin/end matches, so that multiple output lines in expect's
> input buffer aren't matched (=> consumed) by just a single regexp
> line.  This is what all those wacky regexps are for.  Maybe you need
> these too.
>
> e.g., systemtap.base/skipped.exp:
>
>    -re {^WARNING: Number of errors: 0, skipped probes: [0-9]+\r\n} { incr
> ok; exp_continue }
>
>
> - FChE

With the function now not returning errors, we dont this right? I can probably 
use the test case i have sent with TAKE 2?

-- 
Regards,
Varun Chandramohan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]