summaryrefslogtreecommitdiff
path: root/xts5/src/bin/scripts/pt
blob: 0e0f8db35a00f7af0409fee2f2acdfe4dca2d10a (plain)
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
94
95
96
97
98

#
# $XConsortium: pt,v 1.2 92/06/30 17:32:56 rws Exp $
#
# Flags accepted.
#  -v XT_VARIABLE_NAME=Value       Add a variable setting
#  -d display                      Set the display
#  -i <IC's>                       List of IC's to do
#  -p                              Do pixmaps only.
#  -w                              Do windows only.
#  -P                              Pause after each drawing.
#  -D                              Do default depth of screen only.
#  -x <lev>                        Set debug level
#  -g                              Generate pixmaps.
#  -m                              Use macro version of function.

# The display defaults to $DISPLAY
#

trap "rm -f CONFIG" 0

PROG=./Test
if [ ! -f $PROG ]; then
	# If there isn't a ./Test then try for the space saving name.
	THISDIR=`pwd`
	PROG=./`basename $THISDIR`
fi

ICS=
echo > CONFIG

while [ $# -gt 0 ]
do
	case $1 in
	-v)
		echo $2 >> CONFIG
		shift
		;;
	-d)
		echo "DISPLAY=$2" >> CONFIG
		shift
		;;
	-i)
		ICS=$2
		shift
		;;
	-x)
		echo "XT_DEBUG=$2" >> CONFIG
		shift
		;;
	-p)
		echo "XT_DEBUG_PIXMAP_ONLY=YES" >> CONFIG
		;;
	-w)
		echo "XT_DEBUG_WINDOW_ONLY=YES" >> CONFIG
		;;
	-P)
		echo "XT_DEBUG_PAUSE_AFTER=YES" >> CONFIG
		;;
	-D)
		echo "XT_DEBUG_DEFAULT_DEPTHS=YES" >> CONFIG
		;;
	-g)
		PROG=./pvgen
		;;
	-m)
		PROG=./MTest
		;;
	esac
	shift
done

# config=${TET_CONFIG:-$TET_ROOT/xts5/tetexec.cfg}
# Since :- is not universal, and I really want that functionality.
if [ x"$TET_CONFIG" = x"" ]; then
	config=$TET_ROOT/xts5/tetexec.cfg
else
	config=$TET_CONFIG
fi

cat $config >> CONFIG
echo "junk=junk" >> CONFIG	# TEMP

# set TET_CONFIG to our modified file.
TET_CONFIG=CONFIG
export TET_CONFIG

#TET_CODE=${TET_CODE:-$TET_ROOT/xts5/tet_code}
if [ x"$TET_CODE" = x"" ]; then
	TET_CODE=$TET_ROOT/xts5/tet_code
fi
export TET_CODE

rm -f Err*.err

env | grep TET
$PROG $ICS