| 1 |
# This test is to check that modargs work fine |
| 2 |
# Tests initialized and uninitialized global variables, string/number |
| 3 |
|
| 4 |
set test "modargs" |
| 5 |
|
| 6 |
# precompile the script module |
| 7 |
set compile { exec stap $srcdir/$subdir/$test.stp -p4 -w } |
| 8 |
if { [catch { set module [eval $compile] } msg ] } { |
| 9 |
fail "$test compilation: $msg" |
| 10 |
untested "$test module arguments" |
| 11 |
continue |
| 12 |
} else { |
| 13 |
pass "$test compilation" |
| 14 |
} |
| 15 |
|
| 16 |
set test "modargs execution" |
| 17 |
if {! [installtest_p]} { untested $test; return } |
| 18 |
|
| 19 |
set ::result_string {initializedname=foo initializednumber=999 name=charley number=-1} |
| 20 |
set res [ eval exec staprun $module $::result_string ] |
| 21 |
|
| 22 |
if {[string compare $res $::result_string] == 0} { |
| 23 |
pass "$test" |
| 24 |
} else { |
| 25 |
fail "$test, result: $res" |
| 26 |
} |
| 27 |
|