-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_test
More file actions
executable file
·93 lines (83 loc) · 1.96 KB
/
debug_test
File metadata and controls
executable file
·93 lines (83 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
#
#
BASEDIR="/usr/tests/lib/libcurses"
CHECK_PATH="${BASEDIR}/check_files/"
export CHECK_PATH
INCLUDE_PATH="${BASEDIR}/tests/"
export INCLUDE_PATH
#
CURSES_TRACE_FILE="/tmp/ctrace"
SLAVE="${BASEDIR}/slave/slave"
usage() {
echo "Set up the environment to run the test frame. Option flags:"
echo
echo " -c : Set up curses tracing, assumes the curses lib has been built with"
echo " debug enabled. Default trace mask traces input, can be overridden"
echo " by setting the trace mask in the environment before calling the"
echo " The trace file output goes to /tmp/ctrace"
echo " script."
echo " -F : Specify the file name for curses tracing the default is"
echo " ${CURSES_TRACE_FILE}"
echo " -L : Add the argument as a prefix to LD_LIBRARY_PATH to"
echo " use an alternate libcurses version"
echo " -s : Specify the slave command. Defaults to \"../slave/slave\""
echo " -v : Enable verbose output"
echo " -g : Enable check file generation if the file does not exists"
echo " -f : Forces check file generation if -g flag is set"
echo
}
# This is needed for getwin/putwin test case and /tmp can be used for any file
# related tests.
rm -rf /tmp/*
#
ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
#
while getopts cf:L:s:vg opt
do
case "${opt}" in
c)
if [ "X$CURSES_TRACE_MASK" = "X" ]; then
CURSES_TRACE_MASK=0x00000082
fi
export CURSES_TRACE_FILE
export CURSES_TRACE_MASK
;;
F)
CURSES_TRACE_FILE=${OPTARG}
;;
L)
LD_LIBRARY_PATH=${OPTARG}:${LD_LIBRARY_PATH}
;;
s)
SLAVE=${OPTARG}
;;
v)
ARGS="-v ${ARGS}"
;;
g)
ARGS="-g ${ARGS}"
;;
f)
ARGS="-f ${ARGS}"
;;
\?)
usage
exit 1
;;
esac
done
#
shift $((OPTIND - 1))
#
if [ -z "${1}" ]
then
echo
echo "A test name needs to be specified."
echo
usage
echo
exit 1
fi
#
exec ${BASEDIR}/director/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"