Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.apps/tcl.exp

raw
1 set test "tcl"
2
3 # Test sdt support in tcl.
4
5 global env
6
7 if {! [info exists env(SYSTEMTAP_TESTAPPS)] || (
8 ! [string match "tcl" $env(SYSTEMTAP_TESTAPPS)] &&
9 ! [string match "all" $env(SYSTEMTAP_TESTAPPS)])} {
10 untested "$test sdt app"
11 return
12 }
13
14 ########## Create /tmp/stap-tcl.stp ##########
15 set tclreleasemajor "8.6"
16 set tclrelease "8.6b1"
17 set tcldir "[pwd]/tcl/install/"
18 set testsuite "[pwd]"
19
20 verbose -log "Building tcl"
21 set test "tcl${tclreleasemajor} build"
22 set rc [catch {exec sh $srcdir/$subdir/stap-tcl.sh 2>@ stdout} out]
23 if {$rc != 0} {
24 clone_output $out
25 fail $test
26 return
27 } else {
28 pass $test
29 }
30
31 set test "stap-tcl.stp compilation"
32 verbose -log "stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so"
33 set rc [catch {exec stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so} out]
34 clone_output $out
35 if {$rc != 0} {
36 fail $test
37 return
38 } else {
39 pass $test
40 }
41
42 set test "stap-tcl.stp execution"
43 if {![installtest_p]} {
44 untested $test
45 return
46 }
47
48 set ok 0
49 set ko 0
50 set xok 0
51 set lines 0
52 verbose -log "spawn stap -DMAXSKIPPED=8024 -t -c \"tcl/install/bin/tclsh${tclreleasemajor} tcl/src/tests/all.tcl > tcl-test.out\" $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so"
53 spawn stap -DMAXSKIPPED=8024 -t -c "tcl/install/bin/tclsh${tclreleasemajor} tcl/src/tests/all.tcl > tcl-test.out" $srcdir/$subdir/stap-tcl.stp tcl/install/bin/tclsh${tclreleasemajor} tcl/install/lib/libtcl${tclreleasemajor}.so
54 expect {
55 -timeout 2000
56 -re {^OK [^\r\n]*[\r\n]} { incr ok; exp_continue }
57 -re {^KO [^\r\n]*[\r\n]} { incr ko; exp_continue }
58 -re {^ERROR: Skipped[^\r\n]*[\r\n]} { incr xok; exp_continue }
59 -re {^ERROR[^\r\n]*[\r\n]} { incr ko; exp_continue }
60 -re {^[^\r\n]*[\r\n]} { incr lines; exp_continue }
61 timeout { fail "$test (timeout)" }
62 eof { }
63 }
64 catch {close}; catch {wait}
65
66 if {$ok == 14 && $ko == 0} {
67 pass "$test ($ok $ko $lines)"
68 } else {
69 fail "$test ($ok $ko $lines)"
70 }
71 if {$xok == 1} {
72 xfail "$test (skipped probes)"
73 }