This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] add testcases for variables scope
- From: David Smith <dsmith at redhat dot com>
- To: Zhou, Wenjian/åæå <zhouwj-fnst at cn dot fujitsu dot com>, systemtap at sourceware dot org
- Date: Thu, 5 Nov 2015 10:55:28 -0600
- Subject: Re: [PATCH] add testcases for variables scope
- Authentication-results: sourceware.org; auth=none
- References: <1446712067-24880-1-git-send-email-zhouwj-fnst at cn dot fujitsu dot com> <563B3744 dot 6060501 at cn dot fujitsu dot com>
On 11/05/2015 05:02 AM, "Zhou, Wenjian/åæå" wrote:
> Hello David,
>
> During this work, I found some logic in the testsuite is not so correct.
> For example, in the testcase of "if":
> probe end
> {
> println("systemtap ending probe")
> if (1) {
> println("systemtap test success");
> } else {
> println("systemtap test failure");
> }
> if (0) {
> println("systemtap test failure");
> } else {
> println("systemtap test success");
> }
> }
> The output is:
> systemtap ending probe
> systemtap test success
> systemtap test success
>
>
> The testsuite only focus on the first message after "systemtap ending
> probe".
... stuff deleted ...
> I think there are two ways to fix it, if it needs to be fixed.
> 1,
> adjust the function stap_run
>
> 2,
> change the way of printing "systemtap test success" (likes the
> implementation in this patch)
>
> I prefer the second, for it won't introduce some other errors.
You way #2 above would have worked fine. I fixed it with a 3rd solution,
just changing the expected result string to be 2 copies of the
'all_pass_string':
<https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commit;h=0d7d53dd805f636278858651a649d57fb87ba6c8>
Thanks for finding this.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)