Home | History | Annotate | Line # | Download | only in libcurses
debug_test revision 1.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 "	  -L : Add the argument as a prefix to LD_LIBRARY_PATH to"
     24 	echo "	       use an alternate libcurses version"
     25 	echo "    -s : Specify the slave command.  Defaults to \"../slave/slave\""
     26 	echo "    -v : Enable verbose output"
     27 	echo
     28 }
     29 
     30 #
     31 ARGS=""
     32 #
     33 while getopts cf:L:s:v opt
     34 do
     35     case "${opt}" in
     36 	c)
     37 	    if [ "X$CURSES_TRACE_MASK" = "X" ]; then
     38 		CURSES_TRACE_MASK=0x00000082
     39 	    fi
     40 	    export CURSES_TRACE_FILE
     41 	    export CURSES_TRACE_MASK
     42 	    ;;
     43 
     44 	f)
     45 	    CURSES_TRACE_FILE=${OPTARG}
     46 	    ;;
     47 
     48 	L)
     49 	    LD_LIBRARY_PATH=${OPTARG}:${LD_LIBRARY_PATH}
     50 	    ;;
     51 
     52 	s)
     53 	    SLAVE=${OPTARG}
     54 	    ;;
     55 
     56 	v)
     57 	    ARGS="-v"
     58 	    ;;
     59 
     60 	\?)
     61 	    usage
     62 	    exit 1
     63 	    ;;
     64     esac
     65 done
     66 #
     67 shift $((OPTIND - 1))
     68 #
     69 if [ -z "${1}" ]
     70 then
     71 	echo
     72 	echo "A test name needs to be specified."
     73 	echo
     74 	usage
     75 	echo
     76 	exit 1
     77 fi
     78 #
     79 exec ${BASEDIR}/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"
     80