summaryrefslogtreecommitdiff
path: root/xts5
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-06-28 08:09:49 -0700
committerDan Nicholson <dbn.lists@gmail.com>2010-06-28 08:09:49 -0700
commit52012140bffb725452eeeeb5913b553800c4ec32 (patch)
tree25b48c88bf878d6426bd3ae3709138f0e538b902 /xts5
parent115dc059fd1a7d480ac37226ddf551059928d704 (diff)
parent9da20dd6962d6704f4c3517993b633392a3efadd (diff)
Merge remote branch 'whot/master'HEADmaster
Conflicts: xts5/Makefile.am Moved the DISPLAY check to the top-level Makefile.am where check-local is now defined.
Diffstat (limited to 'xts5')
-rw-r--r--xts5/Xlib12/XSendEvent.m3
-rw-r--r--xts5/Xlib13/XGrabButton.m5
-rwxr-xr-xxts5/src/bin/scripts/pt57
-rw-r--r--xts5/src/lib/XInput.c2
-rw-r--r--xts5/src/lib/config.c123
5 files changed, 130 insertions, 60 deletions
diff --git a/xts5/Xlib12/XSendEvent.m b/xts5/Xlib12/XSendEvent.m
index 8e527edc..8296b771 100644
--- a/xts5/Xlib12/XSendEvent.m
+++ b/xts5/Xlib12/XSendEvent.m
@@ -151,7 +151,8 @@ static int event_types[] = {
SelectionNotify,
ColormapNotify,
ClientMessage,
- MappingNotify
+ MappingNotify,
+ GenericEvent
};
>>ASSERTION Good A
A call to xname
diff --git a/xts5/Xlib13/XGrabButton.m b/xts5/Xlib13/XGrabButton.m
index 8bf89eb9..dac8535f 100644
--- a/xts5/Xlib13/XGrabButton.m
+++ b/xts5/Xlib13/XGrabButton.m
@@ -852,6 +852,7 @@ else
Report untested.
>>CODE
extern struct valname S_button[];
+extern int NS_button;
int i;
button = AnyButton;
@@ -865,7 +866,7 @@ int i;
(void) warppointer(display, grab_window, 10, 10);
- for (i = 0; i < nbuttons(); i++) {
+ for (i = 0; i < NS_button; i++) {
buttonpress(display, (unsigned int)S_button[i].val);
if (pgrabbed())
CHECK;
@@ -886,7 +887,7 @@ int i;
CHECK;
}
- CHECKPASS(1+2*nbuttons());
+ CHECKPASS(1+2*NS_button);
>>ASSERTION Good B 3
It is not required that the specified button currently be assigned
to a physical button.
diff --git a/xts5/src/bin/scripts/pt b/xts5/src/bin/scripts/pt
index 0e0f8db3..804edee9 100755
--- a/xts5/src/bin/scripts/pt
+++ b/xts5/src/bin/scripts/pt
@@ -2,33 +2,31 @@
#
# $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.
+usage () {
+echo "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
+GDB=""
+
while [ $# -gt 0 ]
do
case $1 in
@@ -63,13 +61,29 @@ do
-g)
PROG=./pvgen
;;
+ -gdb)
+ GDB=gdb
+ ;;
-m)
PROG=./MTest
;;
+ -h)
+ usage
+ exit 0
+ ;;
+ *)
+ PROG=$1
+ ;;
esac
shift
done
+if [ ! -f "$PROG" ]; then
+ echo "Cannot find test run '$PROG'";
+ exit 1
+fi
+
+
# config=${TET_CONFIG:-$TET_ROOT/xts5/tetexec.cfg}
# Since :- is not universal, and I really want that functionality.
if [ x"$TET_CONFIG" = x"" ]; then
@@ -78,6 +92,11 @@ else
config=$TET_CONFIG
fi
+if [ -z "$TEST_RESFILE" ]; then
+ TET_RESFILE=$PROG.log
+ export TET_RESFILE
+fi
+
cat $config >> CONFIG
echo "junk=junk" >> CONFIG # TEMP
@@ -94,5 +113,5 @@ export TET_CODE
rm -f Err*.err
env | grep TET
-$PROG $ICS
+$GDB $PROG $ICS
diff --git a/xts5/src/lib/XInput.c b/xts5/src/lib/XInput.c
index 04169b79..35c3c95e 100644
--- a/xts5/src/lib/XInput.c
+++ b/xts5/src/lib/XInput.c
@@ -104,7 +104,7 @@ int NumKeys,
ButtonMapLength,
nclass,
nevent,
- event_types[32],
+ event_types[LASTEvent - 2], /* 0 and 1 are reply/error */
MinKeyCode,
MaxKeyCode,
Feedback_Class,
diff --git a/xts5/src/lib/config.c b/xts5/src/lib/config.c
index fa358cc4..0bb3947d 100644
--- a/xts5/src/lib/config.c
+++ b/xts5/src/lib/config.c
@@ -1,4 +1,32 @@
/*
+Copyright (c) 2010 Red Hat, Inc.
+
+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
+AUTHORS OR COPYRIGHT HOLDERS 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.
+
+Modifications:
+ 2010/06/24 - add config setting retrieval from environment.
+ - make all config parameters optional.
+ - set some sane defaults
+
+*/
+
+/*
Copyright (c) 2005 X.Org Foundation L.L.C.
Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -208,46 +236,46 @@ struct getparam parm[] = {
/* General configuration parameters */
- {"XT_COVERAGE", T_INT, (char*)&config.coverage, 0},
- {"XT_ALT_SCREEN", T_INT, (char*)&config.alt_screen, 0},
- {"XT_FONTPATH", T_STRING, (char*)&config.fontpath, 0},
- {"XT_SPEEDFACTOR", T_INT, (char*)&config.speedfactor, 0},
- {"XT_RESET_DELAY", T_INT, (char*)&config.reset_delay, 0},
- {"XT_EXTENSIONS", T_YESNO, (char*)&config.extensions, 0},
+ {"XT_COVERAGE", T_INT, (char*)&config.coverage, FL_OPTIONAL},
+ {"XT_ALT_SCREEN", T_INT, (char*)&config.alt_screen, FL_OPTIONAL},
+ {"XT_FONTPATH", T_STRING, (char*)&config.fontpath, FL_OPTIONAL},
+ {"XT_SPEEDFACTOR", T_INT, (char*)&config.speedfactor, FL_OPTIONAL},
+ {"XT_RESET_DELAY", T_INT, (char*)&config.reset_delay, FL_OPTIONAL},
+ {"XT_EXTENSIONS", T_YESNO, (char*)&config.extensions, FL_OPTIONAL},
/* Configuration parameters for specific tests */
- {"XT_VISUAL_CLASSES", T_STRING, (char*)&config.visual_classes, 0},
- {"XT_FONTCURSOR_GOOD", T_INT, (char*)&config.fontcursor_good, 0},
- {"XT_FONTCURSOR_BAD", T_INT, (char*)&config.fontcursor_bad, 0},
- {"XT_FONTPATH_GOOD", T_STRING, (char*)&config.fontpath_good, 0},
- {"XT_FONTPATH_BAD", T_STRING, (char*)&config.fontpath_bad, 0},
- {"XT_BAD_FONT_NAME", T_STRING, (char*)&config.bad_font_name, 0},
- {"XT_GOOD_COLORNAME", T_STRING, (char*)&config.good_colorname, 0},
- {"XT_BAD_COLORNAME", T_STRING, (char*)&config.bad_colorname, 0},
- {"XT_DISPLAYMOTIONBUFFERSIZE", T_INT, (char*)&config.displaymotionbuffersize, 0},
+ {"XT_VISUAL_CLASSES", T_STRING, (char*)&config.visual_classes, FL_OPTIONAL},
+ {"XT_FONTCURSOR_GOOD", T_INT, (char*)&config.fontcursor_good, FL_OPTIONAL},
+ {"XT_FONTCURSOR_BAD", T_INT, (char*)&config.fontcursor_bad, FL_OPTIONAL},
+ {"XT_FONTPATH_GOOD", T_STRING, (char*)&config.fontpath_good, FL_OPTIONAL},
+ {"XT_FONTPATH_BAD", T_STRING, (char*)&config.fontpath_bad, FL_OPTIONAL},
+ {"XT_BAD_FONT_NAME", T_STRING, (char*)&config.bad_font_name, FL_OPTIONAL},
+ {"XT_GOOD_COLORNAME", T_STRING, (char*)&config.good_colorname, FL_OPTIONAL},
+ {"XT_BAD_COLORNAME", T_STRING, (char*)&config.bad_colorname, FL_OPTIONAL},
+ {"XT_DISPLAYMOTIONBUFFERSIZE", T_INT, (char*)&config.displaymotionbuffersize, FL_OPTIONAL},
/* Configuration parameters for Display functions */
- {"XT_SCREEN_COUNT", T_INT, (char*)&config.screen_count, 0},
- {"XT_PIXMAP_DEPTHS", T_STRING, (char*)&config.pixmap_depths, 0},
- {"XT_BLACK_PIXEL", T_INT, (char*)&config.black_pixel, 0},
- {"XT_WHITE_PIXEL", T_INT, (char*)&config.white_pixel, 0},
- {"XT_HEIGHT_MM", T_INT, (char*)&config.height_mm, 0},
- {"XT_WIDTH_MM", T_INT, (char*)&config.width_mm, 0},
- {"XT_SERVER_VENDOR", T_STRING, (char*)&config.server_vendor, 0},
- {"XT_PROTOCOL_VERSION", T_INT, (char *)&config.protocol_version, 0},
- {"XT_PROTOCOL_REVISION", T_INT, (char *)&config.protocol_revision, 0},
- {"XT_VENDOR_RELEASE", T_INT, (char *)&config.vendor_release, 0},
- {"XT_DOES_SAVE_UNDERS", T_YESNO, (char *)&config.does_save_unders, 0},
- {"XT_DOES_BACKING_STORE", T_INT, (char *)&config.does_backing_store, 0},
+ {"XT_SCREEN_COUNT", T_INT, (char*)&config.screen_count, FL_OPTIONAL},
+ {"XT_PIXMAP_DEPTHS", T_STRING, (char*)&config.pixmap_depths, FL_OPTIONAL},
+ {"XT_BLACK_PIXEL", T_INT, (char*)&config.black_pixel, FL_OPTIONAL},
+ {"XT_WHITE_PIXEL", T_INT, (char*)&config.white_pixel, FL_OPTIONAL},
+ {"XT_HEIGHT_MM", T_INT, (char*)&config.height_mm, FL_OPTIONAL},
+ {"XT_WIDTH_MM", T_INT, (char*)&config.width_mm, FL_OPTIONAL},
+ {"XT_SERVER_VENDOR", T_STRING, (char*)&config.server_vendor, FL_OPTIONAL},
+ {"XT_PROTOCOL_VERSION", T_INT, (char *)&config.protocol_version, FL_OPTIONAL},
+ {"XT_PROTOCOL_REVISION", T_INT, (char *)&config.protocol_revision, FL_OPTIONAL},
+ {"XT_VENDOR_RELEASE", T_INT, (char *)&config.vendor_release, FL_OPTIONAL},
+ {"XT_DOES_SAVE_UNDERS", T_YESNO, (char *)&config.does_save_unders, FL_OPTIONAL},
+ {"XT_DOES_BACKING_STORE", T_INT, (char *)&config.does_backing_store, FL_OPTIONAL},
/* Configuration parameters for connection tests */
- {"XT_POSIX_SYSTEM", T_YESNO, (char*)&config.posix_system, 0},
- {"XT_TCP", T_YESNO, (char *)&config.tcp, 0},
- {"XT_DISPLAYHOST", T_STRING, (char *)&config.displayhost, 0},
- {"XT_LOCAL", T_YESNO, (char *)&config.local, 0},
+ {"XT_POSIX_SYSTEM", T_YESNO, (char*)&config.posix_system, FL_OPTIONAL},
+ {"XT_TCP", T_YESNO, (char *)&config.tcp, FL_OPTIONAL},
+ {"XT_DISPLAYHOST", T_STRING, (char *)&config.displayhost, FL_OPTIONAL},
+ {"XT_LOCAL", T_YESNO, (char *)&config.local, FL_OPTIONAL},
/* Parameters which do not affect test results */
@@ -283,12 +311,13 @@ struct getparam parm[] = {
/* Parameters only used during test development */
{"XT_FONTDIR", T_STRING, (char*)&config.fontdir, FL_OPTIONAL},
- {"XT_LOCALE", T_STRING, (char*)&ximconfig.locale, 0},
+ {"XT_LOCALE", T_STRING, (char*)&ximconfig.locale, FL_OPTIONAL},
{"XT_LOCALE_MODIFIERS", T_STRING,
- (char*)&ximconfig.locale_modifiers, 0},
- {"XT_FONTSET", T_STRING, (char*)&ximconfig.fontsets, 0},
- {"XT_SAVE_IM", T_YESNO, (char*)&ximconfig.save_im, 0},
+ (char*)&ximconfig.locale_modifiers, FL_OPTIONAL},
+ {"XT_FONTSET", T_STRING, (char*)&ximconfig.fontsets, FL_OPTIONAL},
+ {"XT_SAVE_IM", T_YESNO, (char*)&ximconfig.save_im, FL_OPTIONAL},
+ {"DISPLAY", T_STRING, (char*)&config.display, 0}
};
/*
@@ -296,13 +325,13 @@ struct getparam parm[] = {
* parameters.
*/
void
-initconfig()
+_initconfig(char* (*getvar)(const char *))
{
char *var;
struct getparam *gp;
for (gp = parm; gp < parm+NELEM(parm); gp++) {
- var = tet_getvar(gp->name);
+ var = getvar(gp->name);
if (var == NULL) {
if (!(gp->flags&(FL_OPTIONAL|FL_DEBUG)))
report("Required parameter %s was not set", gp->name);
@@ -345,3 +374,23 @@ struct getparam *gp;
}
}
}
+
+void
+initconfig(void)
+{
+ /* set some sane defaults. the strdups might leak, I don't care */
+ config.coverage = 1;
+ config.display = strdup(":0");
+ config.extensions = 1;
+ config.tcp = 1;
+ config.fontpath_bad = strdup("built-ins");
+ config.speedfactor = 1;
+ config.reset_delay = 1;
+ config.protocol_version = 11;
+ config.protocol_revision = 0;
+ config.posix_system = 1;
+ config.local = 1;
+
+ _initconfig(tet_getvar);
+ _initconfig(getenv);
+}