summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2006-10-15 08:37:35 +0000
committerKen Raeburn <raeburn@mit.edu>2006-10-15 08:37:35 +0000
commitb509180e5e536a2b71701c2eb3eca7e2ce34e6d8 (patch)
tree35a2be50d9465f906087ca18f7c854c7ed47bd24 /src
parentf51b8644e9025a2fbce5d82cdba0d8629c7c40bc (diff)
downloadkrb5-b509180e5e536a2b71701c2eb3eca7e2ce34e6d8.tar.gz
krb5-b509180e5e536a2b71701c2eb3eca7e2ce34e6d8.tar.xz
krb5-b509180e5e536a2b71701c2eb3eca7e2ce34e6d8.zip
Pass VALGRIND in to runtest. When it's set, redefine spawn to use it for
most commands starting with "/" but not "/bin/sh" and certain others. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18710 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/tests/dejagnu/Makefile.in3
-rw-r--r--src/tests/dejagnu/config/default.exp40
2 files changed, 41 insertions, 2 deletions
diff --git a/src/tests/dejagnu/Makefile.in b/src/tests/dejagnu/Makefile.in
index 60838bccc9..61fbed088f 100644
--- a/src/tests/dejagnu/Makefile.in
+++ b/src/tests/dejagnu/Makefile.in
@@ -22,7 +22,7 @@ check-runtest-no::
@echo "+++"
check-runtest-yes:: t_inetd site.exp
- $(RUNTEST) --tool krb --srcdir $(srcdir) $(KRB4_RUNTESTFLAGS) PRIOCNTL_HACK=@PRIOCNTL_HACK@ $(RUNTESTFLAGS)
+ $(RUNTEST) --tool krb --srcdir $(srcdir) $(KRB4_RUNTESTFLAGS) PRIOCNTL_HACK=@PRIOCNTL_HACK@ VALGRIND="$(VALGRIND)" $(RUNTESTFLAGS)
t_inetd:: t_inetd.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o t_inetd t_inetd.o $(KRB5_BASE_LIBS)
@@ -44,7 +44,6 @@ runenv.vals: runenv.vars
site.exp: runenv.vals Makefile
echo "set runvarlist [list `cat runenv.vals | tr '\n' ' '`]" | \
sed -e 's%=\.%='`pwd`'/.%g' > site.exp
- echo "set VALGRIND {$(VALGRIND)}" >> site.exp
echo "set KRB5_DB_MODULE_DIR {$(KRB5_DB_MODULE_DIR)}" >> site.exp
# +++ Dependency line eater +++
diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp
index 7f964a3415..0c40553ff7 100644
--- a/src/tests/dejagnu/config/default.exp
+++ b/src/tests/dejagnu/config/default.exp
@@ -54,6 +54,46 @@ if 0 {
}
}
+if { [string length $VALGRIND] } {
+ rename spawn valgrind_aux_spawn
+ proc spawn { args } {
+ global VALGRIND
+ upvar 1 spawn_id spawn_id
+ set newargs {}
+ set inflags 1
+ set eatnext 0
+ foreach arg $args {
+ if { $arg == "-ignore" \
+ || $arg == "-open" \
+ || $arg == "-leaveopen" } {
+ lappend newargs $arg
+ set eatnext 1
+ continue
+ }
+ if [string match "-*" $arg] {
+ lappend newargs $arg
+ continue
+ }
+ if { $eatnext } {
+ set eatnext 0
+ lappend newargs $arg
+ continue
+ }
+ if { $inflags } {
+ set inflags 0
+ # Only run valgrind for local programs, not
+ # system ones.
+ if [string match "/" [string index $arg 0]]&&![string match "/bin/sh" $arg]&&![string match "/bin/ls" $arg]&&![regexp {/kshd$} $arg] {
+ set newargs [concat $newargs $VALGRIND]
+ }
+ }
+ lappend newargs $arg
+ }
+ set pid [eval valgrind_aux_spawn $newargs]
+ return $pid
+ }
+}
+
# Hack around Solaris 9 kernel race condition that causes last output
# from a pty to get dropped.
if { $PRIOCNTL_HACK } {