2009-01-20 19:57:22 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
srcdir=${srcdir-.}
|
|
|
|
builddir=${builddir-.}
|
|
|
|
|
2009-04-04 12:04:35 -06:00
|
|
|
name=xkey
|
|
|
|
prog="$builddir/$name$EXEEXT"
|
|
|
|
log="$builddir/$name.log"
|
2009-04-04 11:52:23 -06:00
|
|
|
|
2009-01-20 19:57:22 -07:00
|
|
|
check_error()
|
|
|
|
{
|
|
|
|
if [ "$2" != "$3" ]; then
|
|
|
|
echo "error checking $1" >&2
|
|
|
|
echo " expected: $2" >&2
|
|
|
|
echo " received: $3" >&2
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2009-01-22 21:10:19 -07:00
|
|
|
check_string()
|
|
|
|
{
|
2009-04-04 12:04:35 -06:00
|
|
|
echo "$prog -s '$1'" >>"$log"
|
|
|
|
val=`$prog -s "$1"` &&
|
2009-04-04 11:52:23 -06:00
|
|
|
echo "$val" >>"$log" &&
|
|
|
|
check_error "$1" "$2" "$val" >>"$log" 2>&1 ||
|
2009-01-22 21:10:19 -07:00
|
|
|
exit $?
|
|
|
|
}
|
2009-01-20 19:57:22 -07:00
|
|
|
|
2009-01-22 21:10:19 -07:00
|
|
|
check_key()
|
|
|
|
{
|
2009-04-04 12:04:35 -06:00
|
|
|
echo "$prog -k '$1'" >>"$log"
|
|
|
|
val=`$prog -k "$1"` && \
|
2009-04-04 11:52:23 -06:00
|
|
|
echo "$val" >>"$log" &&
|
|
|
|
check_error "$1" "$2" "$val" >>"$log" 2>&1 || \
|
2009-01-22 21:10:19 -07:00
|
|
|
exit $?
|
|
|
|
}
|
2009-01-20 19:57:22 -07:00
|
|
|
|
2009-04-04 11:52:23 -06:00
|
|
|
rm -f "$log"
|
|
|
|
|
2009-01-22 21:18:33 -07:00
|
|
|
check_string Undo 0xFF65
|
2009-01-22 21:10:19 -07:00
|
|
|
check_key 0x1008FF56 XF86Close
|
|
|
|
check_string ThisKeyShouldNotExist NoSymbol
|
2009-04-24 22:32:04 -06:00
|
|
|
check_key 0x0 NoSymbol
|
2009-01-22 21:20:02 -07:00
|
|
|
check_string XF86_Switch_VT_5 0x1008FE05
|
|
|
|
check_key 0x1008FE20 XF86_Ungrab
|
2009-04-24 22:32:04 -06:00
|
|
|
check_string VoidSymbol 0xFFFFFF
|
2009-04-24 22:51:16 -06:00
|
|
|
check_key 0x01001234 U1234
|
|
|
|
check_string U4567 0x1004567
|
|
|
|
check_string 0x10203040 0x10203040
|