xref: /netbsd-src/tests/lib/libcurses/debug_test (revision d70ea1b172fc158af0a95709c203dedd8d47e2ce)
1#!/bin/sh
2#
3# Set up the environment to run the test frame.  Option flags:
4#
5# -c : Set up curses tracing, assumes the curses lib has been built with
6#      debug enabled.  Default trace mask traces input, can be overridden
7#      by setting the trace mask in the environment before calling the
8#      script.
9# -s : Specify the slave command.  Defaults to "../slave/slave"
10# -v : Enable verbose output
11#
12BASEDIR="/usr/tests/lib/libcurses"
13CHECK_PATH="${BASEDIR}/check_files/"
14export CHECK_PATH
15INCLUDE_PATH="${BASEDIR}/tests/"
16export INCLUDE_PATH
17#
18SLAVE="${BASEDIR}/slave"
19#
20ARGS=""
21#
22while /usr/bin/true
23do
24    case $1 in
25	-c)
26	    CURSES_TRACE_FILE="/tmp/ctrace"
27	    if [ "X$CURSES_TRACE_MASK" = "X" ]; then
28		CURSES_TRACE_MASK=0x00000082
29	    fi
30	    export CURSES_TRACE_FILE
31	    export CURSES_TRACE_MASK
32	    ;;
33
34	-s)
35	    SLAVE=$2
36	    shift
37	    ;;
38
39	-v)
40	    ARGS="-v"
41	    ;;
42
43	*)
44	    break
45	    ;;
46    esac
47
48    shift
49done
50#
51exec ${BASEDIR}/director ${ARGS} -s ${SLAVE} ${INCLUDE_PATH}/$@
52