Debian Codegraph @

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

raw
1 set test bz10078
2
3 catch {exec gcc -g -o $test $srcdir/$subdir/$test.c} err
4 if {$err == "" && [file exists $test]} then { pass "$test compile" } else { fail "$test compile" }
5
6 if {![uprobes_p]} {
7 catch {exec rm -f $test}
8 untested "$test -p4"
9 untested "$test -p5"
10 return
11 }
12
13 set rc [stap_run_batch $srcdir/$subdir/$test.stp]
14 if {$rc == 0} then { pass "$test -p4" } else { fail "$test -p4" }
15
16 if {! [installtest_p] || ! [uretprobes_p]} {
17 catch {exec rm -f $test}
18 untested "$test -p5"
19 return
20 }
21
22 spawn stap $srcdir/$subdir/$test.stp -c ./$test
23 set ok 0
24 expect {
25 -timeout 60
26 -re {^mkpoint[^\r\n]* returns\r\n} { incr ok; exp_continue }
27 -re {^1,2\r\n} { incr ok; exp_continue }
28 timeout { fail "$test (timeout)" }
29 eof { }
30 }
31 catch { close }; catch { wait }
32 if {$ok == 3} then { pass "$test -p5" } else { fail "$test -p5 ($ok)" }
33 exec rm -f $test