Home | History | Annotate | Line # | Download | only in libcurses
debug_test revision 1.3.2.2
      1  1.3.2.2  christos #!/bin/sh
      2  1.3.2.2  christos #
      3  1.3.2.2  christos #
      4  1.3.2.2  christos BASEDIR="/usr/tests/lib/libcurses"
      5  1.3.2.2  christos CHECK_PATH="${BASEDIR}/check_files/"
      6  1.3.2.2  christos export CHECK_PATH
      7  1.3.2.2  christos INCLUDE_PATH="${BASEDIR}/tests/"
      8  1.3.2.2  christos export INCLUDE_PATH
      9  1.3.2.2  christos #
     10  1.3.2.2  christos CURSES_TRACE_FILE="/tmp/ctrace"
     11  1.3.2.2  christos SLAVE="${BASEDIR}/slave"
     12  1.3.2.2  christos 
     13  1.3.2.2  christos usage() {
     14  1.3.2.2  christos 	echo "Set up the environment to run the test frame.  Option flags:"
     15  1.3.2.2  christos 	echo
     16  1.3.2.2  christos 	echo "    -c : Set up curses tracing, assumes the curses lib has been built with"
     17  1.3.2.2  christos 	echo "         debug enabled.  Default trace mask traces input, can be overridden"
     18  1.3.2.2  christos 	echo "         by setting the trace mask in the environment before calling the"
     19  1.3.2.2  christos 	echo "         The trace file output goes to /tmp/ctrace"
     20  1.3.2.2  christos 	echo "         script."
     21  1.3.2.2  christos 	echo "    -f : Specify the file name for curses tracing the default is"
     22  1.3.2.2  christos 	echo "         ${CURSES_TRACE_FILE}"
     23  1.3.2.2  christos 	echo "	  -L : Add the argument as a prefix to LD_LIBRARY_PATH to"
     24  1.3.2.2  christos 	echo "	       use an alternate libcurses version"
     25  1.3.2.2  christos 	echo "    -s : Specify the slave command.  Defaults to \"../slave/slave\""
     26  1.3.2.2  christos 	echo "    -v : Enable verbose output"
     27  1.3.2.2  christos 	echo
     28  1.3.2.2  christos }
     29  1.3.2.2  christos 
     30  1.3.2.2  christos #
     31  1.3.2.2  christos ARGS=""
     32  1.3.2.2  christos #
     33  1.3.2.2  christos while getopts cf:L:s:v opt
     34  1.3.2.2  christos do
     35  1.3.2.2  christos     case "${opt}" in
     36  1.3.2.2  christos 	c)
     37  1.3.2.2  christos 	    if [ "X$CURSES_TRACE_MASK" = "X" ]; then
     38  1.3.2.2  christos 		CURSES_TRACE_MASK=0x00000082
     39  1.3.2.2  christos 	    fi
     40  1.3.2.2  christos 	    export CURSES_TRACE_FILE
     41  1.3.2.2  christos 	    export CURSES_TRACE_MASK
     42  1.3.2.2  christos 	    ;;
     43  1.3.2.2  christos 
     44  1.3.2.2  christos 	f)
     45  1.3.2.2  christos 	    CURSES_TRACE_FILE=${OPTARG}
     46  1.3.2.2  christos 	    ;;
     47  1.3.2.2  christos 
     48  1.3.2.2  christos 	L)
     49  1.3.2.2  christos 	    LD_LIBRARY_PATH=${OPTARG}:${LD_LIBRARY_PATH}
     50  1.3.2.2  christos 	    ;;
     51  1.3.2.2  christos 
     52  1.3.2.2  christos 	s)
     53  1.3.2.2  christos 	    SLAVE=${OPTARG}
     54  1.3.2.2  christos 	    ;;
     55  1.3.2.2  christos 
     56  1.3.2.2  christos 	v)
     57  1.3.2.2  christos 	    ARGS="-v"
     58  1.3.2.2  christos 	    ;;
     59  1.3.2.2  christos 
     60  1.3.2.2  christos 	\?)
     61  1.3.2.2  christos 	    usage
     62  1.3.2.2  christos 	    exit 1
     63  1.3.2.2  christos 	    ;;
     64  1.3.2.2  christos     esac
     65  1.3.2.2  christos done
     66  1.3.2.2  christos #
     67  1.3.2.2  christos shift $((OPTIND - 1))
     68  1.3.2.2  christos #
     69  1.3.2.2  christos if [ -z "${1}" ]
     70  1.3.2.2  christos then
     71  1.3.2.2  christos 	echo
     72  1.3.2.2  christos 	echo "A test name needs to be specified."
     73  1.3.2.2  christos 	echo
     74  1.3.2.2  christos 	usage
     75  1.3.2.2  christos 	echo
     76  1.3.2.2  christos 	exit 1
     77  1.3.2.2  christos fi
     78  1.3.2.2  christos #
     79  1.3.2.2  christos exec ${BASEDIR}/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"
     80