public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: Zhou Wenjian <zhouwj-fnst@cn.fujitsu.com>,
	systemtap@sourceware.org,        David Smith <dsmith@redhat.com>
Subject: Re: [PATCH 1/3] add testcases for function definitions
Date: Mon, 09 Nov 2015 18:07:00 -0000	[thread overview]
Message-ID: <5640E0EE.2060803@redhat.com> (raw)
In-Reply-To: <1447059456-19811-1-git-send-email-zhouwj-fnst@cn.fujitsu.com>

On 11/09/2015 12:57 AM, Zhou Wenjian wrote:
> +foreach runtime [get_runtime_list] {
> +    if {$runtime != ""} {
> +	stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string}${all_pass_string}${all_pass_string}${all_pass_string} \
> +	    --runtime=$runtime
> +    } else {
> +	stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string}${all_pass_string}${all_pass_string}${all_pass_string}
> +    }
> +}

I disagree with using repetition like this for "exact" results.  The
string already has regex repetition built in:

  set all_pass_string "(systemtap test success\r\n)+"

'+' means match one or more, greedily.  Repeating this expression on top
of itself creates a bad case for the regex engine to backtrack.
(It will work, but slowly.)


IMO we ought to make stap_run ensure nothing comes *after* the expected
output string.  If there are tests that are legitimately printing more
output, those are the ones we should be fixing.

Maybe we could also add the string without repetition, something like:

  set pass_string "systemtap test success\r\n"
  set all_pass_string "($pass_string)+"

Then you can use "($pass_string){5}" if you really want exactly 5
matches.  But stap_run should still make sure nothing comes after that.


  parent reply	other threads:[~2015-11-09 18:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  8:58 Zhou Wenjian
2015-11-09  8:58 ` [PATCH 2/3] Fix the testcases so that the result will be more exact Zhou Wenjian
2015-11-09  8:58 ` [PATCH 3/3] add more test cases for timer Zhou Wenjian
2015-11-09 18:07 ` Josh Stone [this message]
2015-11-09 21:24   ` [PATCH 1/3] add testcases for function definitions David Smith
2015-11-09 22:21     ` Josh Stone
2015-11-10  2:11   ` "Zhou, Wenjian/周文剑"
2015-11-10  2:31     ` Josh Stone
2015-11-10  2:51       ` "Zhou, Wenjian/周文剑"
2015-11-10  7:07         ` "Zhou, Wenjian/周文剑"
2015-11-10 17:34           ` Josh Stone
2015-11-11  6:23             ` "Zhou, Wenjian/周文剑"
2015-11-11 14:03               ` Frank Ch. Eigler
2015-11-11 19:07                 ` David Smith
2015-11-12  2:57                   ` "Zhou, Wenjian/周文剑"
2015-11-26  8:43 Zhou Wenjian
2015-12-01  3:21 ` "Zhou, Wenjian/周文剑"
2015-12-04 13:45   ` David Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5640E0EE.2060803@redhat.com \
    --to=jistone@redhat.com \
    --cc=dsmith@redhat.com \
    --cc=systemtap@sourceware.org \
    --cc=zhouwj-fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).