From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107221 invoked by alias); 9 Nov 2015 08:58:53 -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 107094 invoked by uid 89); 9 Nov 2015 08:58:53 -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; Mon, 09 Nov 2015 08:58:51 +0000 Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 09 Nov 2015 16:58:35 +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 tA98w9G7027084 for ; Mon, 9 Nov 2015 16:58:09 +0800 Received: from localhost.localdomain (10.167.226.48) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Mon, 9 Nov 2015 16:58:47 +0800 From: Zhou Wenjian To: Subject: [PATCH 2/3] Fix the testcases so that the result will be more exact Date: Mon, 09 Nov 2015 08:58:00 -0000 Message-ID: <1447059456-19811-2-git-send-email-zhouwj-fnst@cn.fujitsu.com> In-Reply-To: <1447059456-19811-1-git-send-email-zhouwj-fnst@cn.fujitsu.com> References: <1447059456-19811-1-git-send-email-zhouwj-fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00096.txt.bz2 fix by adding 'all_pass_string': * testsuite/systemtap.base/be_order.exp * testsuite/systemtap.base/global_init.exp * testsuite/systemtap.base/logical_and.exp * testsuite/systemtap.base/tri.exp * testsuite/systemtap.stress/current.exp fix by adjusting the way of printing all_pass_string: * testsuite/systemtap.base/global_vars.stp * testsuite/systemtap.base/timers.stp --- testsuite/systemtap.base/be_order.exp | 4 ++-- testsuite/systemtap.base/global_init.exp | 4 ++-- testsuite/systemtap.base/global_vars.stp | 40 ++++++++++++++++++-------------- testsuite/systemtap.base/logical_and.exp | 4 ++-- testsuite/systemtap.base/timers.stp | 24 +++++++++---------- testsuite/systemtap.base/tri.exp | 4 ++-- testsuite/systemtap.stress/current.exp | 2 +- 7 files changed, 43 insertions(+), 39 deletions(-) diff --git a/testsuite/systemtap.base/be_order.exp b/testsuite/systemtap.base/be_order.exp index eeae818..9398e50 100755 --- a/testsuite/systemtap.base/be_order.exp +++ b/testsuite/systemtap.base/be_order.exp @@ -3,9 +3,9 @@ set test "be_order" foreach runtime [get_runtime_list] { if {$runtime != ""} { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string \ + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string} \ --runtime=$runtime } else { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string} } } diff --git a/testsuite/systemtap.base/global_init.exp b/testsuite/systemtap.base/global_init.exp index 040ac44..d1dabf6 100755 --- a/testsuite/systemtap.base/global_init.exp +++ b/testsuite/systemtap.base/global_init.exp @@ -4,9 +4,9 @@ set test "global_init" foreach runtime [get_runtime_list] { if {$runtime != ""} { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string \ + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string} \ --runtime=$runtime } else { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string} } } diff --git a/testsuite/systemtap.base/global_vars.stp b/testsuite/systemtap.base/global_vars.stp index 737e255..952f3c5 100755 --- a/testsuite/systemtap.base/global_vars.stp +++ b/testsuite/systemtap.base/global_vars.stp @@ -24,34 +24,38 @@ probe begin(-9223372036854775808) { } probe end { - if (c == 42) - println("systemtap test success") - else + ret = 0 + if (c != 42) { + ret = 1; printf("systemtap test failure - c:%d != 42\n", c) + } - if (d == (c + g)) - println("systemtap test success") - else + if (d != (c + g)) { + ret = 1; printf("systemtap test failure - d:%d != %d\n", d, (c+g)) + } - if (a == d) - println("systemtap test success") - else + if (a != d) { + ret = 1; printf("systemtap test failure - a:%d != %d\n", a, d) + } - if (f == c) - println("systemtap test success") - else + if (f != c) { + ret = 1; printf("systemtap test failure - f:%d != %d\n", f, c) + } - if (e[0] == "a") - println("systemtap test success") - else + if (e[0] != "a") { + ret = 1; printf("systemtap test failure - e:%s != a\n", e[0]) + } - if (gstr_saved == "foobar") - println("systemtap test success") - else + if (gstr_saved != "foobar") { + ret = 1; printf("systemtap test failure - gstr_saved:%s != foobar\n", gstr_saved) + } + + if (ret == 0) + println("systemtap test success") } diff --git a/testsuite/systemtap.base/logical_and.exp b/testsuite/systemtap.base/logical_and.exp index 0e52e68..e5a586f 100755 --- a/testsuite/systemtap.base/logical_and.exp +++ b/testsuite/systemtap.base/logical_and.exp @@ -4,9 +4,9 @@ set test "logical_and" foreach runtime [get_runtime_list] { if {$runtime != ""} { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string \ + stap_run $srcdir/$subdir/$test.stp no_load ${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 + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string}${all_pass_string}${all_pass_string} } } diff --git a/testsuite/systemtap.base/timers.stp b/testsuite/systemtap.base/timers.stp index fb590ed..6f4ce9d 100755 --- a/testsuite/systemtap.base/timers.stp +++ b/testsuite/systemtap.base/timers.stp @@ -27,6 +27,7 @@ probe timer.ms(1000000) { ++msmax } probe end { + ret = 0; printf("systemtap ending probe\n") printf("p = %d\n", p) printf("j1 = %d\n", j1) @@ -39,36 +40,35 @@ probe end /* profile counter should be non-zero, and at * least as many as the jiffies(1) counter */ /* (fudge comparison by ~1% since start & end aren't synchronized) */ - if ((p > 0) && (p*100 >= j1*99)) { - printf("systemtap test success\n") - } else { + if ( !((p > 0) && (p*100 >= j1*99)) ) { + ret = 1 printf("unexpected profile count: %d profiles and %d jiffies\n", p, j1) printf("systemtap test failure\n"); } /* jiffies(1) should count more than jiffies(2), * and both should be non-zero. */ - if ((j2 > 0) && (j2 < j1)) { - printf("systemtap test success\n") - } else { + if ( !((j2 > 0) && (j2 < j1)) ) { + ret = 1 printf("unexpected jiffies count\n") printf("systemtap test failure\n"); } /* ms(1) should count more than ms(500), * and both should be non-zero. */ - if ((ms500 > 0) && (ms500 < ms1)) { - printf("systemtap test success\n") - } else { + if ( !((ms500 > 0) && (ms500 < ms1)) ) { + ret = 1 printf("unexpected ms count\n") printf("systemtap test failure\n"); } /* both 'infinite' intervals should register zero counts */ - if ((jmax == 0) && (msmax == 0)) { - printf("systemtap test success\n") - } else { + if ( !((jmax == 0) && (msmax == 0)) ) { + ret = 1 printf("unexpected count on 'infinite' interval\n") printf("systemtap test failure\n"); } + + if ( ret == 0 ) + printf("systemtap test success\n") } diff --git a/testsuite/systemtap.base/tri.exp b/testsuite/systemtap.base/tri.exp index c980284..34c7e09 100755 --- a/testsuite/systemtap.base/tri.exp +++ b/testsuite/systemtap.base/tri.exp @@ -4,9 +4,9 @@ set test "tri" foreach runtime [get_runtime_list] { if {$runtime != ""} { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string \ + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string}${all_pass_string} \ --runtime=$runtime } else { - stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string + stap_run $srcdir/$subdir/$test.stp no_load ${all_pass_string}${all_pass_string}${all_pass_string} } } diff --git a/testsuite/systemtap.stress/current.exp b/testsuite/systemtap.stress/current.exp index 313b67a..b7a3d78 100755 --- a/testsuite/systemtap.stress/current.exp +++ b/testsuite/systemtap.stress/current.exp @@ -19,6 +19,6 @@ proc current_load {} { return 0 } -set output_string "(\\w+ = \\d+\r\n){5}${all_pass_string}(WARNING.*skipped.*)?" +set output_string "(\\w+ = \\d+\r\n){5}${all_pass_string}${all_pass_string}(WARNING.*skipped.*)?" stap_run $srcdir/$subdir/$test.stp current_load $output_string -g -w -- 1.8.3.1