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] add testcases for variables scope


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)


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