summaryrefslogtreecommitdiff
path: root/xc/unsupported/test/InsPEX/README
blob: df1454168010813b2449e07887e0b73631e54454 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
/* $XConsortium: README,v 5.3 91/02/22 12:18:00 hersh Exp $ */

/*****************************************************************

Copyright (c) 1989, 1990, 1991  X Consortium

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.

Copyright (c) 1989, 1990, 1991 by Sun Microsystems, Inc.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of Sun Microsystems
not be used in advertising or publicity pertaining to distribution
of the software without specific, written prior permission.  

SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT 
SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/


		InsPEX, the PEX test suite
		--------------------------

InsPEX is an automated test suite for testing PEX, through
the PHIGS/PHIGS+ C language binding.  It performs operations
through PHIGS functions, and tests for the expected results
using the PHIGS binding itself, and Xlib.  Many tests use an
interpreter for faster execution time and more efficient
test development.  Tests requiring verification of pixels
use Xlib to retrieve pixel and color map information; the
resulting images are either verified automatically, or
compared against saved images.  An X-based tool, Inspector,
is supplied for comparing images against saved reference
images, and saving the new images as acceptable images if
desired. 

YOU MUST HAVE A VALID X3D-PEX SERVER RUNNING BEFORE YOU 
START THE InsPEX TEST SUITE. IT WILL NOT START A SERVER FOR YOU!!!

This file contains:

       * Some comments on porting.

       * A brief list of other sources for information about InsPEX.  
	The PEX-SI User Guide, in particular, should be referred to 
	for a more complete description of the test suite. 

	* Some comments on this release of InsPEX.




		PORTING ISSUES
		--------------

Portability Goals and Non-Goals
-------------------------------

InsPEX is intended to work with 8-bit pseudocolor framebuffers.  We
assume Unix, and have the goal of working under both System V and BSD
systems.  We also intend InsPEX to work on any 32-bit machine
architecture.  We do not have the goal of working on non-Unix systems
or different frame buffer depths.  

While support for other frame buffer depths is not built
into InsPEX, some provisions were made for porting to other
depths.  In the definition of the file format for saved images,
found in the comment for i_save_image() in tools/pexint/pixutils.c,
the first byte is intended to identify the type of file.
The only supported type is PSEUDOCOLOR, but other types could
be defined and added.  Their structure after the description string,
width, and height fields would be different, and this first byte
would be used to differentiate how the files were created and should
be handled.

Porting Tests and the Interpreter
---------------------------------

Some portable data types are declared in portable.h in 
INSPEXHOME/tools/pexint, for use in the interpreter and other
tests.  

We have tried to use system calls that are common to both
System V and BSD Unix.  Some SysV incompatibities reported
by an alert sponsor have been fixed, though they require
a "SYSV" to be defined during compilation (see the description
of I_CFLAGS in the Release Notes or inspex.sh, for a method
to set this if it isn't set by the compiler).

Porting the Inspector
---------------------

The chief portability issue for the Inspector is the choice
of Graphical User Interface toolkit.  The current implementation
uses the XView toolkit, which is available from the X Consortium
and from Sun Microsystems.  

To facilitate porting, however, all toolkit-specific code is
isolated into two files, toolkit.c and toolkit.h.  Through
typedefs and function definitions, these files create a separate
interface layer on top of the toolkit being used.  While this
interface looks like a toolkit itself, it has no pretense of being
a general-purpose toolkit -- it was designed strictly to
make this particular application easily portable.  The
interface types and functions should be implementable using
any toolkit.  An incomplete and non-working port to Athena
Widgets is included; if someone can finish this and get it going,
please share it with the PEX community.

Notification, or call-back, procedures are attached to the buttons
of the control panel; since we can't be sure of of what arguments
a given toolkit wants to supply to these functions, they
are expected to be defined without any arguments.  The negative
side to this solution is that it forces greater use of global
variables.

The scrolling list could be implemented as a menu or other
control item.  Selecting the file name in the list could
be used to control loading of files, rather than the current
method of selecting and then hitting "load".


		OTHER DOCUMENTS
		---------------

PEX-SI User Guide - the section on InsPEX is the most detailed
document for the test suite available.

PEX-SI Release Notes - this is not likely to contain any 
information that's not also to be found in this README.

A man page for the NewT interpreter builder is in
$INSPEXHOME/tools/newt/newt.man.  This describes the process of
building an interpreter, the files required, and also the language
understood by the resulting interpreters.

The header comment of the main script, inspex.sh, has
a description of the various option switches and
environment variables used by the test suite.

The file test_descrip in this directory contains an
automatically-extracted description of all the supplied tests.  Every
C-based and interpreter-based test contains a brief description of
what the test does, in a comment marked with "##".  These comments can
be automatically extracted by searching for this sequence, with a
script such as this one:

#!/bin/csh
# extract_doc.csh - given a set of file names, extract the documentation
# lines in them and print them in a nicely separated fashion.
# Documentation lines are marked by a "##".
foreach file ($*)
	echo $file -----
	# extract comment lines, remove '##' and indent slightly.
	grep "##" $file | sed -e "s/##//" | sed -e "s/^/  /"
	echo ""
end
# end of extract_doc.csh.

Here's the command used to create test_descrip in this directory:
	csh% cd $INSPEXHOME
	csh% extract_doc.csh testcases/*/*.{c,pi} > test_descrip




Notes for the final release of the PEX-SI:
-----------------------------------------

This information can also be found in the Release Notes.


This release of InsPEX has greatly increased test coverage,
and some new features.  The areas covered include all the
PHIGS-PLUS graphics primitives, such as fill area sets with data,
quadrilateral meshes, triangle strips, and NURBS.  PHIGS-PLUS
attributes such as direct color specification, depth cuing,
and lighting are also exercised.

The testing of input is somewhat limited by the problem
of simulating mouse and keyboard input in a reliable and 
portable fashion.  For the pick, locator, and stroke devices,
simulating the mouse events is straightforward, but since
the string, valuator, and choice devices are built upon
a toolkit (Athena Widgets in the PEX-SI's case), getting
window ID's for the appropriate windows and sending mouse
clicks to the right place on those windows is more difficult,
and probably impossible to do in a way that could be quickly
ported to another toolkit along with these input devices.
The technology for automatic testing of software using
a graphical user interface under X has not progressed to the
point where we could test this functionality in a way
that would be useful to all the potential users of InsPEX.

For nearly all of the tests that use image comparison
to verify graphical output, we have supplied reference
images generated here using the PEX-SI code.  Due to outstanding
bugs in the code, however, some tests are shipped without
reference images.  Also, since back-facing attributes
are not implemented, the images saved for these tests are
actually incorrect.  We decided to ship them, however,
because they still can be helpful to someone porting
the PEX-SI.  It should be expected that when backfacing
attributes are implemented, these tests will fail and
image comparison will be required.

Along with the README in the main InsPEX directory, there
is a sample log file, sample.log, and an automatically-generated
summary of all the current tests, test_descrip.  See
the README for a description of how that file was
generated.


Running the InsPEX Test Suite
-----------------------------------------

1) MAKE SURE YOU HAVE AN X3D-PEX SERVER RUNNING

2) Go to INSPEXHOME. Set the DISPLAY environment variable and the PEXAPIDIR
environment variable to the proper values. It is also helpful to set MAXFAIL 
to some reasonable value, otherwise InsPEX will stop after test failures.
Also use the VERBOSITY variable to get more clues. See the Using InsPEX 
section of the PEX-SI User Guide.


3) Type run_InsPEX. If you have not changed the relative locations of the
X and PEX directories wrt to the root tree as it appeared on your tape
then InsPEX will go off on its merry way (hopefully) performing a make or two, 
executing interpreted test scripts, compiling and executing some c language 
test programs and reporting the results. If you have moved things around you 
can use these shell scripts:

run_InsPEX
inspex.sh
startpex

as a guide to making versions that will work on your system. Remeber to
try to finesse all environment variables to absolute pathnames as relative
pathnames will make your life hell. Don't curse me I didn't write these scripts
Good Luck.

	  -----------------------------------------

Unix is a trademark of AT&T.