From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107052 invoked by alias); 9 Nov 2015 08:58:52 -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 107041 invoked by uid 89); 9 Nov 2015 08:58:51 -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:50 +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 tA98w7BU027078 for ; Mon, 9 Nov 2015 16:58:08 +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:46 +0800 From: Zhou Wenjian To: Subject: [PATCH 1/3] add testcases for function definitions Date: Mon, 09 Nov 2015 08:58:00 -0000 Message-ID: <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/msg00095.txt.bz2 * testsuite/systemtap.base/func_definition.exp: New test case. * testsuite/systemtap.base/func_definition.stp: New test file. --- testsuite/systemtap.base/func_definition.exp | 13 ++++++ testsuite/systemtap.base/func_definition.stp | 60 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100755 testsuite/systemtap.base/func_definition.exp create mode 100755 testsuite/systemtap.base/func_definition.stp diff --git a/testsuite/systemtap.base/func_definition.exp b/testsuite/systemtap.base/func_definition.exp new file mode 100755 index 0000000..2fddf9b --- /dev/null +++ b/testsuite/systemtap.base/func_definition.exp @@ -0,0 +1,13 @@ +# Check function definitions + +set test "func_definition" +if {![installtest_p]} { untested "$test"; return } + +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} + } +} diff --git a/testsuite/systemtap.base/func_definition.stp b/testsuite/systemtap.base/func_definition.stp new file mode 100755 index 0000000..eaa8d94 --- /dev/null +++ b/testsuite/systemtap.base/func_definition.stp @@ -0,0 +1,60 @@ +/* + * func_definition.stp + * + * Check function definitions + */ +probe begin { + println("systemtap starting probe") +} + + +function f1(arg:long) +{ + if (arg == 2015) + println("systemtap test success") + else + printf("systemtap test failure - arg of f1:%d != 2015\n", arg) +} + +function f2(arg) +{ + if (arg == 2015) + println("systemtap test success") + else + printf("systemtap test failure - arg of f2:%d != 2015\n", arg) +} + +function f3:long() +{ + return 2015 +} + +function f4() +{ + return 2015 +} + +function f5() +{ + println("systemtap test success") +} + +probe end { + println("systemtap ending probe") + + f1(2015) + + f2(2015) + + if (f3() == 2015) + println("systemtap test success") + else + printf("systemtap test failure - return_value of f3:%d != 2015\n", f3()) + + if (f4() == 2015) + println("systemtap test success") + else + printf("systemtap test failure - return_value of f4:%d != 2015\n", f4()) + + f5() +} -- 1.8.3.1