2009-01-20 19:57:22 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
srcdir=${srcdir-.}
|
|
|
|
builddir=${builddir-.}
|
|
|
|
|
2009-04-04 11:52:23 -06:00
|
|
|
log="$builddir/xkey.log"
|
|
|
|
|
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 11:52:23 -06:00
|
|
|
echo "${builddir}/xkey -s '$1'" >>"$log"
|
2009-01-22 21:10:19 -07:00
|
|
|
val=`${builddir}/xkey -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 11:52:23 -06:00
|
|
|
echo "${builddir}/xkey -k '$1'" >>"$log"
|
2009-01-22 21:10:19 -07:00
|
|
|
val=`${builddir}/xkey -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
|
|
|
|
check_key 0x0 NULL
|
2009-01-22 21:20:02 -07:00
|
|
|
check_string XF86_Switch_VT_5 0x1008FE05
|
|
|
|
check_key 0x1008FE20 XF86_Ungrab
|