From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14335 invoked by alias); 10 Nov 2015 02:11:28 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 14325 invoked by uid 89); 10 Nov 2015 02:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: heian.cn.fujitsu.com Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Nov 2015 02:11:27 +0000 Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 10 Nov 2015 10:11:12 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id tAA2AjXB030474; Tue, 10 Nov 2015 10:10:45 +0800 Received: from localhost.localdomain (10.167.226.48) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.181.6; Tue, 10 Nov 2015 10:11:23 +0800 Message-ID: <56415207.6050905@cn.fujitsu.com> Date: Tue, 10 Nov 2015 02:11:00 -0000 From: =?UTF-8?B?Ilpob3UsIFdlbmppYW4v5ZGo5paH5YmRIg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Josh Stone CC: , David Smith Subject: Re: [PATCH 1/3] add testcases for function definitions References: <1447059456-19811-1-git-send-email-zhouwj-fnst@cn.fujitsu.com> <5640E0EE.2060803@redhat.com> In-Reply-To: <5640E0EE.2060803@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00101.txt.bz2 On 11/10/2015 02:07 AM, Josh Stone wrote: > 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. > > I think either of them is enough to generate the correct result. Why should stap_run still make sure nothing comes after matching the exact output? And between them, I prefer matching the exact output. To make sure nothing comes, we have to modify all cases which use the stap_run. I don't think it's a good idea that modifying the cases which are working well. -- Thanks Zhou