This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH 2/2] [TAKE 3] Testcase For str_replace()
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Varun Chandramohan <varunc at linux dot vnet dot ibm dot com>
- Cc: systemtap at sourceware dot org, Josh Stone <jistone at redhat dot com>
- Date: Thu, 18 Jun 2009 11:04:20 -0400
- Subject: Re: [PATCH 2/2] [TAKE 3] Testcase For str_replace()
- References: <20090618153001.b71522ac.varunc@linux.vnet.ibm.com>
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