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