diff options
Diffstat (limited to 'bdb/test/wrap.tcl')
-rw-r--r-- | bdb/test/wrap.tcl | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/bdb/test/wrap.tcl b/bdb/test/wrap.tcl index 4a5c825d8f0..aaceb4f74e6 100644 --- a/bdb/test/wrap.tcl +++ b/bdb/test/wrap.tcl @@ -1,12 +1,19 @@ -# Sentinel file wrapper for multi-process tests. -# This is designed to avoid a set of nasty bugs, primarily on Windows, -# where pid reuse causes watch_procs to sit around waiting for some -# random process that's not DB's and is not exiting. +# See the file LICENSE for redistribution information. +# +# Copyright (c) 2000-2002 +# Sleepycat Software. All rights reserved. +# +# $Id: wrap.tcl,v 11.6 2002/04/25 13:35:02 bostic Exp $ +# +# Sentinel file wrapper for multi-process tests. This is designed to avoid a +# set of nasty bugs, primarily on Windows, where pid reuse causes watch_procs +# to sit around waiting for some random process that's not DB's and is not +# exiting. source ./include.tcl +source $test_path/testutils.tcl # Arguments: -# if { $argc < 3 } { puts "FAIL: wrap.tcl: Usage: wrap.tcl script log scriptargs" exit @@ -33,13 +40,17 @@ set childsentinel $testdir/begin.$childpid set f [open $childsentinel w] close $f +puts $t "source $test_path/test.tcl" +puts $t "set script $script" + # Set up argv for the subprocess, since the args aren't passed in as true # arguments thanks to the pipe structure. puts $t "set argc [llength $args]" puts $t "set argv [list $args]" -# Command the test to run. -puts $t "source $test_path/$script" +puts $t {set ret [catch { source $test_path/$script } result]} +puts $t {if { [string length $result] > 0 } { puts $result }} +puts $t {error_check_good "$test_path/$script run: pid [pid]" $ret 0} # Close the pipe. This will flush the above commands and actually run the # test, and will also return an error a la exec if anything bad happens @@ -55,4 +66,6 @@ close $f set f [open $testdir/end.$parentpid w] close $f +error_check_good "Pipe close ($childpid: $script $argv: logfile $logfile)"\ + $ret 0 exit $ret |