Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/global_opt.exp

raw
1 # Check stap global variable option (-G)
2
3 set test "global_opt"
4 if {![installtest_p]} {
5 untested $test
6 return
7 }
8
9 set script "global var1=9 ; probe begin { if (var1 == 29) println(\"systemtap test success\") else println(\"systemtap test failure\") ; exit() }"
10
11 foreach runtime [get_runtime_list] {
12 set test "global_opt"
13 if {$runtime != ""} {
14 set test "${test}_${runtime}"
15 spawn stap -G var1=29 -e $script --runtime=$runtime
16 } else {
17 spawn stap -G var1=29 -e $script
18 }
19 expect {
20 -timeout 60
21 "systemtap test success" { pass $test }
22 "systemtap test failure" { fail $test }
23 timeout {fail "$test: unexpected timeout"}
24 eof {fail "$test: unexpected EOF"}
25 }
26 catch {close}; catch {wait}
27 }
28