Support Tizen 3.0
[profile/ivi/ico-uxf-weston-plugin.git] / tests / weston-plugin-test
1 #!/bin/sh
2 #
3 #       Weston IVI Plugin Test
4 #
5 #         Remark: This examination premises that Weston does not run.
6
7 # 1 Delete log file
8 mkdir ../tests/testlog 2> /dev/null
9 rm -fr ../tests/testlog/* 2> /dev/null
10
11 # 2 Start Pseudo event device (for Touch Panel)
12 ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log &
13 sleep 1
14
15 # 3 Weston/Wayland Envionment
16 export QT_QPA_PLATFORM=wayland
17 export ELM_ENGINE=wayland_egl
18 export ECORE_EVAS_ENGINE=wayland_egl
19 export XDG_RUNTIME_DIR=/run/user/5000
20
21 # 4 Set Environment for Test
22 export WESTON_IVI_PLUGIN_DIR="../src/.libs"
23
24 # 5 Start Weston
25 export XDG_CONFIG_HOME="../tests"
26 MOD_DIR="$PWD/../src/.libs"
27 /usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
28 sleep 1
29
30 # 6 Set library path
31 export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
32
33 # 7 Start test-homescreen
34 ../tests/test-homescreen < ../tests/testdata/hs_alltest.dat 2> ../tests/testlog/test-homescreen.log
35
36 # 8 End of Test
37 sleep 2
38 /usr/bin/killall weston
39 /usr/bin/killall test-send_event
40 sleep 1
41
42 # 9 Check Error
43 FOUND_ERR=0
44 /bin/grep "ERR>" testlog/*
45 if [ "$?" != "1" ] ; then
46         FOUND_ERR=1
47 fi
48 /bin/grep "WRN>" testlog/*
49 if [ "$?" != "1" ] ; then
50         FOUND_ERR=1
51 fi
52 /bin/grep "Error" testlog/*
53 if [ "$?" != "1" ] ; then
54         FOUND_ERR=1
55 fi
56 /bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test"
57 if [ "$?" != "1" ] ; then
58         FOUND_ERR=1
59 fi
60 /bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight"
61 if [ "$?" != "1" ] ; then
62         FOUND_ERR=1
63 fi
64
65 if [ $FOUND_ERR = 0 ] ; then
66         echo "Weston IVI Plugin Test: OK"
67 else
68         echo "Weston IVI Plugin Test: ERROR"
69 fi
70