summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--evdevtest/juice_evtest.c2
-rwxr-xr-xevdevtest/juice_evtest.sh17
2 files changed, 16 insertions, 3 deletions
diff --git a/evdevtest/juice_evtest.c b/evdevtest/juice_evtest.c
index 32ddf2b..d110cb8 100644
--- a/evdevtest/juice_evtest.c
+++ b/evdevtest/juice_evtest.c
@@ -18,7 +18,7 @@
#define JUICE_ERROR(X) \
do \
- printf("##Juice error: %s in %s at line %d ##\n", X, __FUNCTION__, __LINE__); \
+ printf("##Juice error: %s in %s at line %d ##: %s\n", X, __FUNCTION__, __LINE__, strerror(errno)); \
while(0)
#define DELAY 10
diff --git a/evdevtest/juice_evtest.sh b/evdevtest/juice_evtest.sh
index 4f5f2e0..9c3dd20 100755
--- a/evdevtest/juice_evtest.sh
+++ b/evdevtest/juice_evtest.sh
@@ -7,6 +7,8 @@ if [ ! -e /system/modules/juice_input_test_module.ko ]; then
exit
fi
+rmmod juice_input_test_module
+
insmod /system/modules/juice_input_test_module.ko
rc=$?
if [ $rc -ne 0 ]; then
@@ -14,10 +16,21 @@ if [ $rc -ne 0 ]; then
exit
fi
-N=`dmesg |grep Juice|awk -F '' '{print $NF}'`
+input_dev=""
+for dev in $(ls /dev/input/event*);do
+ if getevent -i "${dev}"|grep -q "Juice EVDEV Test Module"; then
+ input_dev=${dev}
+ break
+ fi
+done
+
+if [ -z "${input_dev}" ]; then
+ echo "Failed to find the input device for kernel evdev test"
+ exit 1
+fi
echo "Evdev IOCTL CMD TEST START"
-juice_evtest -p /dev/input/event$N
+juice_evtest -p ${input_dev}
rc=$?
if [ $rc -ne 0 ]; then
echo "Evdev IOCTL CMD TEST FAIL!"