Debian Codegraph @

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

raw
1 set test "enum"
2 set stap_path $env(SYSTEMTAP_PATH)/stap
3
4 # exp_internal 1
5
6 set xflags "additional_flags=-g"
7 set xflags "$xflags additional_flags=-L[pwd] additional_flags=[pwd]/libenum.so"
8 set xflags "$xflags additional_flags=-Wl,-rpath-link,[pwd]"
9 set exepath "[pwd]/enum.x"
10 set soflags "additional_flags=-shared"
11 set soflags "$soflags additional_flags=-g"
12 set soflags "$soflags additional_flags=-fPIC"
13 set soflags "$soflags additional_flags=-DSHARED"
14 set sopath "[pwd]/libenum.so"
15 set reso [target_compile $srcdir/$subdir/enum.cxx $sopath \
16 executable $soflags ]
17 set res [target_compile $srcdir/$subdir/enum.cxx $exepath \
18 executable $xflags ]
19 if {$res != ""} {
20 fail "$test compiling enum.c"
21 return
22 } else {
23 pass "$test compiling enum.c"
24 }
25
26 foreach runtime [get_runtime_list] {
27 if {$runtime != ""} {
28 set test_type "$test ($runtime)"
29 } else {
30 set runtime "kernel"
31 set test_type $test
32 }
33
34 set ok 0
35 spawn $stap_path --runtime=$runtime -g $srcdir/$subdir/enum.stp -c $exepath $sopath
36 expect {
37 -timeout 180
38 -re "(\"sixteen_power_8\" is 0x100000000|\"C\" is C|\"green\" is 2|\"fourth\" is 4|\"c\" is c|\"sharp\" is #|\"astruct->third\" is 3|\"astruct->ordinal\" is 1|\"mexico\" is 2)\r\n" { incr ok; exp_continue }
39 eof { }
40 }
41 catch {close}; catch {wait}
42 if {$ok == 10} {
43 pass "$test $runtime"
44 } else {
45 fail "$test $runtime ($ok/10)"
46 }
47 }