summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.apps/tcl.exp
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-10-31 13:54:41 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-10-31 13:58:38 -0400
commit2c279bc4231e44dba80e5fdb10aa1626e412eab3 (patch)
treec931b7a898830dea6684b091e9f2c2c9585d241c /testsuite/systemtap.apps/tcl.exp
parent5b8642a208b614769f934c6a4ce2991658025a57 (diff)
downloadsystemtap-steved-2c279bc4231e44dba80e5fdb10aa1626e412eab3.tar.gz
systemtap-steved-2c279bc4231e44dba80e5fdb10aa1626e412eab3.tar.xz
systemtap-steved-2c279bc4231e44dba80e5fdb10aa1626e412eab3.zip
reorganize app tests; rewrite tcl as sample of improvements
* testsuite/configure.ac (--enable-testapps): New option. * testsuite/Makefile.am (TESTAPPS): Pass to dejagnu. * testsuite/systemtap.base/{xulrunner,tcl,mysql,postgres}: Moved under new systemtap.apps/ subdirectory. * testsuite/systemtap.apps/stap-tcl.sh: New file to build tcl. * testsuite/systemtap.apps/stap-tcl.stp: New file to test tcl. * testsuite/systemtap.apps/tcl.exp: New simplified test driver. * dtrace.in: Disable STAP_HAS_SEMAPHORES as they don't work on shlibs yet. * includes/sys/sdt.h (STAP_SEMAPHORE): Include __builtin_expect for unlikely.
Diffstat (limited to 'testsuite/systemtap.apps/tcl.exp')
-rw-r--r--testsuite/systemtap.apps/tcl.exp67
1 files changed, 67 insertions, 0 deletions
diff --git a/testsuite/systemtap.apps/tcl.exp b/testsuite/systemtap.apps/tcl.exp
new file mode 100644
index 00000000..bfcf2239
--- /dev/null
+++ b/testsuite/systemtap.apps/tcl.exp
@@ -0,0 +1,67 @@
+set test "tcl"
+
+# Test sdt support in tcl.
+
+global env
+
+if {! [info exists env(SYSTEMTAP_TESTAPPS)] || (
+ ! [string match "tcl" $env(SYSTEMTAP_TESTAPPS)] &&
+ ! [string match "all" $env(SYSTEMTAP_TESTAPPS)])} {
+ untested "$test sdt app"
+ return
+}
+
+########## Create /tmp/stap-tcl.stp ##########
+set tclreleasemajor "8.6"
+set tclrelease "8.6b1"
+set tcldir "[pwd]/tcl/install/"
+set testsuite "[pwd]"
+
+verbose -log "Building tcl"
+set test "tcl${tclreleasemajor} build"
+set rc [catch {exec sh $srcdir/$subdir/stap-tcl.sh 2>@ stdout} out]
+if {$rc != 0} {
+ clone_output $out
+ fail $test
+ return
+} else {
+ pass $test
+}
+
+set test "stap-tcl.stp compilation"
+set rc [catch {exec stap -DMAXSKIPPED=8024 -t -p4 $srcdir/$subdir/stap-tcl.stp tcl/install/lib/libtcl${tclreleasemajor}.so} out]
+clone_output $out
+if {$rc != 0} {
+ fail $test
+ return
+} else {
+ pass $test
+}
+
+set test "stap-tcl.stp execution"
+if {![installtest_p]} {
+ untested $test
+ return
+}
+
+set ok 0
+set ko 0
+set lines 0
+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/lib/libtcl${tclreleasemajor}.so
+expect {
+ -timeout 1000
+ -re {^OK [^\r\n]*[\r\n]} { incr ok; exp_continue }
+ -re {^KO [^\r\n]*[\r\n]} { incr ko; exp_continue }
+ -re {^ERROR[^\r\n]*[\r\n]} { incr ko; exp_continue }
+ -re {^[^\r\n]*[\r\n]} { incr lines; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+catch {close}; catch {wait}
+
+if {$ok == 14 && $ko == 0} {
+ pass "$test ($ok $ko $lines)"
+} else {
+ fail "$test ($ok $ko $lines)"
+}
+