diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/systemtap.base/modargs.exp | 24 | ||||
-rw-r--r-- | testsuite/systemtap.base/modargs.stp | 11 |
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(); +} |