summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharley Wang <chwang@redhat.com>2010-02-25 14:21:27 -0500
committerCharley Wang <chwang@redhat.com>2010-02-25 14:21:27 -0500
commit4bfb04268d548c4d711784de6b129aef2fc1577b (patch)
tree81ee2ffd0ae9f511ae9522daff455e68c5a09b97
parentc69a87e094e5e66daee8399838c8475f023ddc04 (diff)
downloadsystemtap-steved-4bfb04268d548c4d711784de6b129aef2fc1577b.tar.gz
systemtap-steved-4bfb04268d548c4d711784de6b129aef2fc1577b.tar.xz
systemtap-steved-4bfb04268d548c4d711784de6b129aef2fc1577b.zip
PR11224: added test case for module arguments in testsuite/systemtap.base
-rw-r--r--testsuite/systemtap.base/modargs.exp24
-rw-r--r--testsuite/systemtap.base/modargs.stp11
2 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/modargs.exp b/testsuite/systemtap.base/modargs.exp
new file mode 100644
index 00000000..b8d31244
--- /dev/null
+++ b/testsuite/systemtap.base/modargs.exp
@@ -0,0 +1,24 @@
+# This test is to check that modargs work fine
+# Tests initialized and uninitialized global variables, string/number
+
+set test "modargs"
+
+# precompile the script module
+set compile { exec stap $srcdir/$subdir/$test.stp -p4 -w }
+if { [catch { set module [eval $compile] } msg ] } {
+ fail "$test compilation: $msg"
+ untested "$test module arguments"
+ continue
+} else {
+ pass "$test compilation"
+}
+
+set ::result_string {initializedname=foo initializednumber=999 name=charley number=-1}
+set res [ exec staprun $module $::result_string ]
+
+if {[string compare $res $::result_string] == 0} {
+ pass "$test execution"
+} else {
+ fail "$test execution, result: $res"
+}
+
diff --git a/testsuite/systemtap.base/modargs.stp b/testsuite/systemtap.base/modargs.stp
new file mode 100644
index 00000000..d00c13a7
--- /dev/null
+++ b/testsuite/systemtap.base/modargs.stp
@@ -0,0 +1,11 @@
+
+global initializedname="bar"
+global initializednumber=0
+global name
+global number
+
+probe begin
+{
+ printf ("initializedname=%s initializednumber=%d name=%s number=%d", initializedname, initializednumber, name, number);
+ exit();
+}