#!/bin/sh # Drive a single test through a series of limits (32 to 1) # Arguments # # - Configuration # - File containing the test. # - Name of Test # # Result on stdout: Max. stacksize which still fails. # ========================================================== # Get arguments, and check them ... cfg=$1 ftst=$2 tst=$3 if [ X$cfg = X -o X$ftst = X -o X$tst = X ] then echo Usage: $0 config file-of-test test exit -1 fi # ========================================================== # Derived information, independent of limit (ie. outside of # test loop) cd `dirname $0`/../work/build/$cfg topdir=`grep ^TOP_DIR Makefile | sed -e 's/.*= *//'` btl=`grep ^TCL_BUILDTIME_LIBRARY Makefile | sed -e 's/.*= *//'` script=$topdir/tests/all.tcl LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; LIBPATH=`pwd`:${LIBPATH}; export LIBPATH; SHLIB_PATH=`pwd`:${SHLIB_PATH}; export SHLIB_PATH; TCL_LIBRARY="$btl"; export TCL_LIBRARY; ulimit -c 0 ; # disable generation of core files. # ========================================================== for limit in \ 48 47 46 45 44 43 42 41 \ 40 39 38 37 36 35 34 33 \ 32 31 30 29 28 27 26 25 \ 24 23 22 21 20 19 18 17 \ 16 15 14 13 12 11 10 9 \ 8 7 6 5 4 3 2 1 do res=`(ulimit -s $limit ; ./tcltest $script -match $tst -file $ftst > /dev/null 2>/dev/null ; echo $?)` # Stop the moment we have a crash. All smaller sizes will # crash too, so there is no point in exercising them. # We log only the first size a crash occurs. if [ $res -ne 0 ]; then echo $tst $limit break; fi done