summaryrefslogtreecommitdiffstats
path: root/testsuite/lib
diff options
context:
space:
mode:
authorfche <fche>2007-03-14 15:20:45 +0000
committerfche <fche>2007-03-14 15:20:45 +0000
commit5ba96b9022078048e9f916431d3b8792a9dc8615 (patch)
tree8a9ef21f25cbb117e2473d96730a07f89e2559d2 /testsuite/lib
parent3b6fd2ea934f1d75174e5a786701c90f32553fe8 (diff)
downloadsystemtap-steved-5ba96b9022078048e9f916431d3b8792a9dc8615.tar.gz
systemtap-steved-5ba96b9022078048e9f916431d3b8792a9dc8615.tar.xz
systemtap-steved-5ba96b9022078048e9f916431d3b8792a9dc8615.zip
2007-03-13 Frank Ch. Eigler <fche@redhat.com>
PR 4171. * Makefile.am (check, installcheck): Pass build-tree pointers in environment variables. * configure.ac: Run separate configury for testsuite/. * configure, Makefile.in: Regenerated. 2007-03-14 Frank Ch. Eigler <fche@redhat.com> PR 4171. * configure.ac, configure, aclocal.m4: New files to permit testsuite-only build tree. * Makefile.am (RUNTEST): Arrange a crazy concoction of environment/make variable for runtest. * Makefile.in: Regenerated. * */*.stp: Switch test cases from "./stap" to "stap" throughout. * lib/systemtap.exp: Assume/trace environment variables. (stap_run_batch): Add "#! stap"-handling hack.
Diffstat (limited to 'testsuite/lib')
-rw-r--r--testsuite/lib/systemtap.exp44
1 files changed, 29 insertions, 15 deletions
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp
index dc92c0c1..7f534967 100644
--- a/testsuite/lib/systemtap.exp
+++ b/testsuite/lib/systemtap.exp
@@ -31,28 +31,22 @@ proc setup_systemtap_environment {} {
global srcdir prefix env
# need an absolute SRCDIR for the top-level src/ tree
+ # XXX: or, we could change nearby uses of ${SRCDIR}/testsuite to ${SRCDIR}
if {[string index $srcdir 0] != "/"} then {
set env(SRCDIR) [exec pwd]/$srcdir/..
} else {
set env(SRCDIR) $srcdir/..
}
- if [installtest_p] {
- # To run installcheck against a system install systemtap,
- # use "make prefix=/usr installcheck"
- set env(LD_LIBRARY_PATH) $prefix/lib/systemtap
- set env(SYSTEMTAP_TAPSET) $prefix/share/systemtap/tapset
- set env(SYSTEMTAP_RUNTIME) $prefix/share/systemtap/runtime
- set env(PATH) $prefix/bin:$env(PATH)
- } else {
- set env(LD_LIBRARY_PATH) ../lib-elfutils:../lib-elfutils/systemtap
- set env(SYSTEMTAP_TAPSET) $env(SRCDIR)/tapset
- set env(SYSTEMTAP_RUNTIME) $env(SRCDIR)/runtime
- set env(PATH) ..:$env(PATH)
- }
-
# Use a local systemtap directory and cache
set env(SYSTEMTAP_DIR) [exec pwd]/.systemtap
+
+ # PATH, SYSTEMTAP_TAPSET, SYSTEMTAP_RUNTIME, LD_LIBRARY_PATH are already set.
+ foreach var {PATH STAP SRCDIR SYSTEMTAP_TAPSET SYSTEMTAP_RUNTIME SYSTEMTAP_DIR LD_LIBRARY_PATH} {
+ if [info exists env($var)] {
+ verbose -log "env $var = $env($var)"
+ }
+ }
}
@@ -66,7 +60,27 @@ proc systemtap_exit {} {}
proc stap_run_batch {args} {
verbose -log "starting $args"
- spawn $args
+
+ # Many of our test cases use "#! stap ...". Since these lack
+ # /full/paths, they are not really executable. (We can't have
+ # /full/paths because the choice of systemtap interpreter is set
+ # at "make check" time.)
+
+ # So we cheat. If the file begins with "#! stap", we will spawn
+ # stap manually here (relying on $PATH). Otherwise, we presume
+ # the file properly executable.
+
+ set file [open [lindex $args 0] r]
+ set firstbits [gets $file]
+ close $file
+ if [regexp -line {\#! stap (.*)} $firstbits -> stap_args] {
+ verbose -log "spawn1 stap $stap_args [lindex $args 0]"
+ spawn stap $stap_args [lindex $args 0]
+ } else {
+ verbose -log "spawn2 $args"
+ spawn $args
+ }
+
expect {
-re {[^\r]*\r} { verbose -log $expect_out(0,string); exp_continue }
eof { }