[PATCH] add testcases for variables scope

"Zhou, Wenjian/周文剑" zhouwj-fnst@cn.fujitsu.com
Fri Nov 6 01:10:00 GMT 2015


On 11/06/2015 12:55 AM, David Smith wrote:
> 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.
>

The testcase "if" is just an example.
There are still many other testcases having this problem...
Should I fix it?

-- 
Thanks
Zhou



More information about the Systemtap mailing list