From 0d97f74cc1665e091dbce1c1463851ffce2d4be8 Mon Sep 17 00:00:00 2001 From: Hayato Nakamura Date: Thu, 19 Sep 2013 19:57:14 +0900 Subject: Fix for - Weston sometimes crashes at the time of surface createion. Change-Id: If014ed540bb3b376fd735c29756c6ff8f05ff469 Signed-off-by: Hayato Nakamura --- packaging/ico-uxf-weston-plugin.changes | 11 ++ packaging/ico-uxf-weston-plugin.spec | 4 +- protocol/ico_input_mgr.xml | 31 +++-- settings/ico_weston.csh | 2 - settings/ico_weston.sh | 2 - src/Makefile.am | 2 +- src/ico_input_mgr.c | 87 +++++++++++++- src/ico_input_mgr.h | 13 ++- src/ico_ivi_common.h | 4 +- src/ico_ivi_shell.c | 44 ++++--- src/ico_ivi_shell.h | 14 ++- src/ico_window_mgr.c | 62 ++++++---- tests/Makefile.am | 3 +- tests/test-client.c | 92 ++++++++++++++- tests/test-common.c | 63 +++++++++- tests/test-common.h | 6 +- tests/test-homescreen.c | 201 +++++++++++++++++++++++++------- tests/test-thumbnail.c | 124 +------------------- tests/testdata/cl_inputregion.dat | 47 ++++++++ tests/testdata/hs_inputregion.dat | 40 +++++++ tests/weston-plugin-test | 20 ++-- tests/weston-plugin-test.anima | 20 ++-- tests/weston-plugin-test.homescreen | 36 ------ tests/weston-plugin-test.input | 20 ++-- tests/weston-plugin-test.map | 20 ++-- tests/weston-plugin-test.notouch | 70 ----------- tests/weston-plugin-test.region | 64 ++++++++++ tests/weston-plugin-test.resize | 20 ++-- tests/weston-plugin-test.resize_flower | 70 ----------- tests/weston-plugin-test.resize_native | 70 ----------- tests/weston-plugin-test.resize_smoke | 74 ------------ tests/weston-plugin-test.resize_smoke2 | 70 ----------- tests/weston-plugin-test.send_input | 20 ++-- tests/weston-plugin-test.slide | 68 ----------- tests/weston-plugin-test_gdb | 71 ----------- 35 files changed, 727 insertions(+), 838 deletions(-) delete mode 100644 settings/ico_weston.csh delete mode 100644 settings/ico_weston.sh create mode 100644 tests/testdata/cl_inputregion.dat create mode 100644 tests/testdata/hs_inputregion.dat delete mode 100755 tests/weston-plugin-test.homescreen delete mode 100755 tests/weston-plugin-test.notouch create mode 100755 tests/weston-plugin-test.region delete mode 100755 tests/weston-plugin-test.resize_flower delete mode 100755 tests/weston-plugin-test.resize_native delete mode 100755 tests/weston-plugin-test.resize_smoke delete mode 100755 tests/weston-plugin-test.resize_smoke2 delete mode 100755 tests/weston-plugin-test.slide delete mode 100755 tests/weston-plugin-test_gdb diff --git a/packaging/ico-uxf-weston-plugin.changes b/packaging/ico-uxf-weston-plugin.changes index cfcbbcd..f768f00 100644 --- a/packaging/ico-uxf-weston-plugin.changes +++ b/packaging/ico-uxf-weston-plugin.changes @@ -1,3 +1,14 @@ +* Thu Sep 19 2013 Shibata Makoto submit/tizen/20130919.011341@e71fb82 +- 0.9.04 release. +-- fix for - Weston sometimes crashes at the time of surface creation. +-- Weston crashes when an event comes from DRM just after shell surface creation, because shader is +-- unestablished, it is necessary to set default shader at the time of shell surface creation. +-- fix for - Remove /etc/profile.d/ico_weston.sh +-- The change of the interface of the input region for haptic device. +-- internal bug fix. +-- Deletion of an unnecessary files. + + * Thu Sep 19 2013 Shibata Makoto accepted/tizen/20130911.005338@d5948b7 - 0.9.03-2.1 release -- Remove the installation to /etc/profile.d/* . diff --git a/packaging/ico-uxf-weston-plugin.spec b/packaging/ico-uxf-weston-plugin.spec index 4d7a2ed..4e1bfbd 100644 --- a/packaging/ico-uxf-weston-plugin.spec +++ b/packaging/ico-uxf-weston-plugin.spec @@ -1,7 +1,7 @@ Name: ico-uxf-weston-plugin Summary: Weston Plugins for IVI -Version: 0.9.03 -Release: 2.1 +Version: 0.9.04 +Release: 1.1 Group: Graphics & UI Framework/Automotive UI License: MIT URL: "" diff --git a/protocol/ico_input_mgr.xml b/protocol/ico_input_mgr.xml index 400dcd9..e2e9e6f 100644 --- a/protocol/ico_input_mgr.xml +++ b/protocol/ico_input_mgr.xml @@ -46,16 +46,22 @@ - + - + + + + + + + - - + + @@ -113,6 +119,15 @@ + + + Input region change method for input region change event. + + + + + + Define input switch from Input Controller @@ -146,11 +161,11 @@ - - - Send input region to haptic controller. + + + Send input regions to haptic controller. - + diff --git a/settings/ico_weston.csh b/settings/ico_weston.csh deleted file mode 100644 index 66a11e2..0000000 --- a/settings/ico_weston.csh +++ /dev/null @@ -1,2 +0,0 @@ -setenv XDG_RUNTIME_DIR /run/user/5000 -setenv XDG_CONFIG_HOME /etc/xdg/weston diff --git a/settings/ico_weston.sh b/settings/ico_weston.sh deleted file mode 100644 index 65a827f..0000000 --- a/settings/ico_weston.sh +++ /dev/null @@ -1,2 +0,0 @@ -export XDG_RUNTIME_DIR=/run/user/5000 -export XDG_CONFIG_HOME=/etc/xdg/weston diff --git a/src/Makefile.am b/src/Makefile.am index 26e6570..9a4a7f4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,7 +9,7 @@ pkginclude_HEADERS = \ ico_input_mgr.h libico_uxf_weston_plugin_la_LIBADD = -lrt -lm -libico_uxf_weston_plugin_la_LDFLAGS = -version-info 0:7:0 +libico_uxf_weston_plugin_la_LDFLAGS = -version-info 0:9:0 libico_uxf_weston_plugin_la_SOURCES = \ desktop-shell-protocol.c \ input-method-protocol.c \ diff --git a/src/ico_input_mgr.c b/src/ico_input_mgr.c index 8ea1a4a..6049c31 100644 --- a/src/ico_input_mgr.c +++ b/src/ico_input_mgr.c @@ -45,6 +45,7 @@ #include "ico_ivi_shell.h" #include "ico_window_mgr.h" #include "ico_input_mgr.h" +#include "ico_window_mgr-server-protocol.h" #include "ico_input_mgr-server-protocol.h" /* degine maximum length */ @@ -156,6 +157,18 @@ static void ico_mgr_del_input_app(struct wl_client *client, struct wl_resource * static void ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource, const char *appid, uint32_t surfaceid, int32_t type, int32_t deviceno, int32_t code, int32_t value); + /* set input region */ +static void ico_mgr_set_input_region(struct wl_client *client, struct wl_resource *resource, + const char *target, int32_t x, int32_t y, + int32_t width, int32_t height, int32_t hotspot_x, + int32_t hotspot_y, int32_t cursor_x, int32_t cursor_y, + int32_t cursor_width, int32_t cursor_height, + uint32_t attr); + /* unset input region */ +static void ico_mgr_unset_input_region(struct wl_client *client, + struct wl_resource *resource, + const char *taret, int32_t x, int32_t y, + int32_t width, int32_t height); /* create and regist Input Controller table*/ static void ico_device_configure_input(struct wl_client *client, struct wl_resource *resource, const char *device, @@ -171,14 +184,20 @@ static void ico_device_input_event(struct wl_client *client, struct wl_resource int32_t input, int32_t code, int32_t state); /* definition of Wayland protocol */ -/* mgr interface */ +/* Input Manager Control interface */ static const struct ico_input_mgr_control_interface ico_input_mgr_implementation = { ico_mgr_add_input_app, ico_mgr_del_input_app, ico_mgr_send_input_event }; -/* Input Controller interface */ +/* Extended Input interface */ +static const struct ico_exinput_interface ico_exinput_implementation = { + ico_mgr_set_input_region, + ico_mgr_unset_input_region +}; + +/* Input Controller Device interface */ static const struct ico_input_mgr_device_interface input_mgr_ictl_implementation = { ico_device_configure_input, ico_device_configure_code, @@ -677,6 +696,66 @@ ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource, uifw_trace("ico_mgr_send_input_event: Leave"); } +/*--------------------------------------------------------------------------*/ +/** + * @brief ico_mgr_set_input_region: set input region for haptic devcie + * + * @param[in] client client(Device Input Controller) + * @param[in] resource resource of request + * @param[in] target target window (winname@appid) + * @param[in] x input region X coordinate + * @param[in] y input region X coordinate + * @param[in] width input region width + * @param[in] height input region height + * @param[in] hotspot_x hotspot of X relative coordinate + * @param[in] hotspot_y hotspot of Y relative coordinate + * @param[in] cursor_x cursor region X coordinate + * @param[in] cursor_y cursor region X coordinate + * @param[in] cursor_width cursor region width + * @param[in] cursor_height cursor region height + * @param[in] attr region attributes(currently unused) + * @return none + */ +/*--------------------------------------------------------------------------*/ +static void +ico_mgr_set_input_region(struct wl_client *client, struct wl_resource *resource, + const char *target, int32_t x, int32_t y, + int32_t width, int32_t height, int32_t hotspot_x, + int32_t hotspot_y, int32_t cursor_x, int32_t cursor_y, + int32_t cursor_width, int32_t cursor_height, uint32_t attr) +{ + uifw_trace("ico_mgr_set_input_region: Enter(%s %d/%d-%d/%d(%d/%d) %d/%d-%d/%d)", + target, x, y, width, height, hotspot_x, hotspot_y, + cursor_x, cursor_y, cursor_width, cursor_height); + + uifw_trace("ico_mgr_set_input_region: Leave"); +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief ico_mgr_unset_input_region: unset input region for haptic devcie + * + * @param[in] client client(Device Input Controller) + * @param[in] resource resource of request + * @param[in] target target window (winname@appid) + * @param[in] x input region X coordinate + * @param[in] y input region X coordinate + * @param[in] width input region width + * @param[in] height input region height + * @return none + */ +/*--------------------------------------------------------------------------*/ +static void +ico_mgr_unset_input_region(struct wl_client *client, struct wl_resource *resource, + const char *target, int32_t x, int32_t y, + int32_t width, int32_t height) +{ + uifw_trace("ico_mgr_unset_input_region: Enter(%s %d/%d-%d/%d)", + target, x, y, width, height); + + uifw_trace("ico_mgr_unset_input_region: Leave"); +} + /*--------------------------------------------------------------------------*/ /** * @brief ico_device_configure_input: configure input device and input switch @@ -1004,7 +1083,7 @@ ico_device_bind(struct wl_client *client, void *data, uint32_t version, uint32_t mgr_resource = wl_resource_create(client, &ico_input_mgr_device_interface, 1, id); if (mgr_resource) { wl_resource_set_implementation(mgr_resource, &input_mgr_ictl_implementation, - NULL, ico_device_unbind); + pInputMgr, ico_device_unbind); } uifw_trace("ico_device_bind: Leave"); } @@ -1072,7 +1151,7 @@ ico_exinput_bind(struct wl_client *client, void *data, uint32_t version, uint32_ if (! pAppMgr->resource) { pAppMgr->resource = wl_resource_create(client, &ico_exinput_interface, 1, id); if (pAppMgr->resource) { - wl_resource_set_implementation(pAppMgr->resource, NULL, + wl_resource_set_implementation(pAppMgr->resource, &ico_exinput_implementation, pInputMgr, ico_exinput_unbind); } } diff --git a/src/ico_input_mgr.h b/src/ico_input_mgr.h index 4961289..c23cba9 100644 --- a/src/ico_input_mgr.h +++ b/src/ico_input_mgr.h @@ -30,8 +30,11 @@ /* Input Region struct for Haptic Device Controller */ struct ico_uifw_input_region { + uint16_t change; /* change method */ + /* ICO_INPUT_MGR_DEVICE_REGION_ADD */ + /* ICO_INPUT_MGR_DEVICE_REGION_REMOVE */ + /* ICO_INPUT_MGR_DEVICE_REGION_REMOVEALL*/ uint16_t node; /* display node */ - uint16_t res; /* (unused) */ uint32_t surfaceid; /* surface Id */ uint16_t surface_x; /* surface absolute X coordinate */ uint16_t surface_y; /* surface absolute Y coordinate */ @@ -39,7 +42,13 @@ struct ico_uifw_input_region { uint16_t y; /* input region relative Y coordinate */ uint16_t width; /* input region width */ uint16_t height; /* input region height */ - int32_t attr; /* input region attribute */ + int16_t hotspot_x; /* hotspot of X relative coordinate */ + int16_t hotspot_y; /* hotspot of Y relative coordinate */ + uint16_t cursor_x; /* cursor region X coordinate */ + uint16_t cursor_y; /* cursor region Y coordinate */ + uint16_t cursor_width; /* cursor region width */ + uint16_t cursor_height; /* cursor region height */ + uint32_t attr; /* input region attribute */ }; #endif /*_ICO_INPUT_MGR_H_*/ diff --git a/src/ico_ivi_common.h b/src/ico_ivi_common.h index 1fd0ad4..b5dfabc 100644 --- a/src/ico_ivi_common.h +++ b/src/ico_ivi_common.h @@ -42,9 +42,9 @@ /* System limit */ #define ICO_IVI_MAX_DISPLAY (8) /* Maximum numer of displays in a ECU */ -#define ICO_IVI_APPID_LENGTH (128) /* Maximum length of applicationId(AppCore) */ +#define ICO_IVI_APPID_LENGTH (80) /* Maximum length of applicationId(AppCore) */ /* (with terminate NULL) */ -#define ICO_IVI_WINNAME_LENGTH (32) /* Maximum length of window name (with NULL)*/ +#define ICO_IVI_WINNAME_LENGTH (40) /* Maximum length of window name (with NULL)*/ #define ICO_IVI_ANIMATION_LENGTH (16) /* Maximum length of animation name (w NULL)*/ #define ICO_IVI_MAX_COORDINATE (16383) /* Maximum X or Y coordinate */ diff --git a/src/ico_ivi_shell.c b/src/ico_ivi_shell.c index 3b88783..3507296 100644 --- a/src/ico_ivi_shell.c +++ b/src/ico_ivi_shell.c @@ -166,6 +166,7 @@ struct desktop_shell { enum animation_type win_animation_type; }; +#if 0 /* move to ico_ivi_shell.h */ enum shell_surface_type { SHELL_SURFACE_NONE, SHELL_SURFACE_TOPLEVEL, @@ -175,6 +176,7 @@ enum shell_surface_type { SHELL_SURFACE_POPUP, SHELL_SURFACE_XWAYLAND }; +#endif struct ping_timer { struct wl_event_source *source; @@ -1280,13 +1282,15 @@ shell_surface_move(struct wl_client *client, struct wl_resource *resource, struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_surface *surface; - surface = weston_surface_get_main_surface(seat->pointer->focus); - if (seat->pointer->button_count > 0 && seat->pointer->grab_serial == serial) { + if (seat->pointer && + seat->pointer->button_count > 0 && + seat->pointer->grab_serial == serial) { surface = weston_surface_get_main_surface(seat->pointer->focus); if ((surface == shsurf->surface) && (surface_move(shsurf, seat) < 0)) wl_resource_post_no_memory(resource); - } else if (seat->touch->grab_serial == serial) { + } else if (seat->touch && + seat->touch->grab_serial == serial) { surface = weston_surface_get_main_surface(seat->touch->focus); if ((surface == shsurf->surface) && (surface_touch_move(shsurf, seat) < 0)) @@ -2477,6 +2481,10 @@ create_shell_surface(void *shell, struct weston_surface *surface, shsurf->fullscreen.framerate = 0; shsurf->fullscreen.black_surface = NULL; shsurf->ping_timer = NULL; + + /* set default color and shader because weston original bug(some time crash weston) */ + weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1); + wl_list_init(&shsurf->fullscreen.transform.link); wl_signal_init(&shsurf->destroy_signal); @@ -3221,10 +3229,7 @@ click_to_activate_binding(struct weston_seat *seat, uint32_t time, uint32_t butt struct weston_surface *focus; struct weston_surface *main_surface; - if (button == BTN_LEFT) - focus = (struct weston_surface *) seat->pointer->focus; - else - focus = (struct weston_surface *) seat->touch->focus; + focus = (struct weston_surface *) seat->pointer->focus; if (!focus) return; @@ -4637,9 +4642,6 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell) weston_compositor_add_button_binding(ec, BTN_LEFT, 0, click_to_activate_binding, shell); - weston_compositor_add_button_binding(ec, BTN_TOUCH, 0, - click_to_activate_binding, - shell); weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL, MODIFIER_SUPER | MODIFIER_ALT, surface_opacity_binding, NULL); @@ -4812,7 +4814,7 @@ module_init(struct weston_compositor *ec, /*--------------------------------------------------------------------------*/ /** - * @brief ico_ivi_shell_current_layer: get current weston layer + * @brief ico_ivi_shell_weston_layer: get weston layer * * @param none * @return current weston layer @@ -4822,11 +4824,9 @@ module_init(struct weston_compositor *ec, /*--------------------------------------------------------------------------*/ /* API for other plugin */ WL_EXPORT struct weston_layer * -ico_ivi_shell_current_layer(void) +ico_ivi_shell_weston_layer(void) { - struct workspace *ws = get_current_workspace(_ico_ivi_shell); - - return (ws != NULL) ? &ws->layer : NULL; + return(&_ico_ivi_shell->panel_layer); } /*--------------------------------------------------------------------------*/ @@ -4843,6 +4843,20 @@ ico_ivi_shell_set_toplevel(struct shell_surface *shsurf) set_toplevel(shsurf); } +/*--------------------------------------------------------------------------*/ +/** + * @brief ico_ivi_shell_get_surfacetype: get surface type + * + * @param[in] shsurf shell surface + * @return surface type + */ +/*--------------------------------------------------------------------------*/ +WL_EXPORT int +ico_ivi_shell_get_surfacetype(struct shell_surface *shsurf) +{ + return (shsurf ? (int)shsurf->type : -1); +} + /*--------------------------------------------------------------------------*/ /** * @brief ico_ivi_shell_set_surface_type: set surface type diff --git a/src/ico_ivi_shell.h b/src/ico_ivi_shell.h index 64610ff..ef6fcec 100644 --- a/src/ico_ivi_shell.h +++ b/src/ico_ivi_shell.h @@ -32,9 +32,21 @@ struct shell_surface; +/* surface type */ +enum shell_surface_type { + SHELL_SURFACE_NONE, + SHELL_SURFACE_TOPLEVEL, + SHELL_SURFACE_TRANSIENT, + SHELL_SURFACE_FULLSCREEN, + SHELL_SURFACE_MAXIMIZED, + SHELL_SURFACE_POPUP, + SHELL_SURFACE_XWAYLAND +}; + /* Prototype for get/set function */ -struct weston_layer *ico_ivi_shell_current_layer(void); +struct weston_layer *ico_ivi_shell_weston_layer(void); void ico_ivi_shell_set_toplevel(struct shell_surface *shsurf); +int ico_ivi_shell_get_surfacetype(struct shell_surface *shsurf); void ico_ivi_shell_set_surface_type(struct shell_surface *shsurf); void ico_ivi_shell_send_configure(struct weston_surface *surface, const uint32_t edges, const int width, const int height); diff --git a/src/ico_window_mgr.c b/src/ico_window_mgr.c index ada2f62..005fef0 100644 --- a/src/ico_window_mgr.c +++ b/src/ico_window_mgr.c @@ -69,7 +69,7 @@ #define ICO_WINDOW_MGR_ANIMATION_POS 0x10000000 /* wl_buffer (inport from wayland-1.2.0/src/wayland-server.h) */ -struct uifw_wl_buffer { +struct uifw_wl_buffer { /* struct wl_buffer */ struct wl_resource resource; int32_t width, height; uint32_t busy_count; @@ -87,7 +87,7 @@ struct uifw_drm_buffer { }; /* __DRIimage (inport from mesa-9.1.3/src/mesa/drivers/dri/intel/intel_regions.h) */ -struct uifw_dri_region { +struct uifw_intel_region { /* struct intel_region */ void *bo; /**< buffer manager's buffer */ uint32_t refcount; /**< Reference count for region */ uint32_t cpp; /**< bytes per pixel */ @@ -100,15 +100,15 @@ struct uifw_dri_region { uint32_t name; /**< Global name for the bo */ void *screen; /* screen */ }; -struct uifw_dri_image { - struct uifw_dri_region *region; +struct uifw_dri_image { /* struct __DRIimageRec */ + struct uifw_intel_region *region; int internal_format; uint32_t dri_format; uint32_t format; uint32_t offset; uint32_t strides[3]; uint32_t offsets[3]; - void *planar_format; /* image_format */ + void *planar_format; /* intel_image_format */ void *data; }; @@ -118,7 +118,7 @@ enum buffer_type { BUFFER_TYPE_SHM, BUFFER_TYPE_EGL }; -struct uifw_gl_surface_state { +struct uifw_gl_surface_state { /* struct gl_surface_state */ GLfloat color[4]; struct gl_shader *shader; @@ -1114,18 +1114,33 @@ ico_window_mgr_restack_layer(struct uifw_win_surface *usurf, const int omit_touc int32_t buf_width, buf_height; float new_x, new_y; struct weston_layer *wlayer; + struct weston_surface *surface, *surfacetmp; int num_visible = 0; - uifw_trace("ico_window_mgr_restack_layer: Enter(surf=%08x,omit=%d)", - (int)usurf, omit_touch); - /* make compositor surface list */ - wlayer = ico_ivi_shell_current_layer(); + wlayer = ico_ivi_shell_weston_layer(); + + uifw_trace("ico_window_mgr_restack_layer: Enter(surf=%08x,omit=%d) layer=%08x", + (int)usurf, omit_touch, (int)wlayer); + /* remove all surfaces in panel_layer */ + wl_list_for_each_safe(surface, surfacetmp, &wlayer->surface_list, layer_link) { + wl_list_remove(&surface->layer_link); + wl_list_init(&surface->layer_link); + } wl_list_init(&wlayer->surface_list); - wl_list_for_each (el, &_ico_win_mgr->ivi_layer_list, link) { + + wl_list_for_each (el, &_ico_win_mgr->ivi_layer_list, link) { wl_list_for_each (es, &el->surface_list, ivi_layer) { - if ((es->mapped != 0) && (es->surface != NULL)) { + /* if surface not exist or surface type is not TopLevel, Skip */ + if ((es->surface == NULL) || + (ico_ivi_shell_get_surfacetype(es->shsurf) != SHELL_SURFACE_TOPLEVEL)) { + continue; + } + wl_list_remove(&es->surface->layer_link); + wl_list_init(&es->surface->layer_link); + + if (es->mapped != 0) { if ((el->visible == FALSE) || (es->visible == FALSE) || ((omit_touch != FALSE) && ((el->layer_type == ICO_WINDOW_MGR_LAYER_TYPE_INPUT) || @@ -1133,7 +1148,7 @@ ico_window_mgr_restack_layer(struct uifw_win_surface *usurf, const int omit_touc new_x = (float)(ICO_IVI_MAX_COORDINATE+1); new_y = (float)(ICO_IVI_MAX_COORDINATE+1); } - else if (es->surface->buffer_ref.buffer) { + else if (es->surface->buffer_ref.buffer) { buf_width = weston_surface_buffer_width(es->surface); buf_height = weston_surface_buffer_height(es->surface); if (es->width > buf_width) { @@ -1143,7 +1158,7 @@ ico_window_mgr_restack_layer(struct uifw_win_surface *usurf, const int omit_touc else { new_x = (float)es->x; } - if (es->height > buf_height) { + if (es->height > buf_height) { new_y = (float) (es->y + (es->height - es->surface->geometry.height)/2); } @@ -1166,11 +1181,12 @@ ico_window_mgr_restack_layer(struct uifw_win_surface *usurf, const int omit_touc weston_surface_damage(es->surface); } #if 0 /* too many debug log */ - uifw_debug("ico_window_mgr_restack_layer:%3d(%d).%08x(%d) " + uifw_trace("ico_window_mgr_restack_layer:%3d(%d).%08x(%08x:%d) " "x/y=%d/%d w/h=%d/%d", - el->layer, el->visible, es->surfaceid, es->visible, - (int)es->surface->geometry.x, (int)es->surface->geometry.y, - es->surface->geometry.width, es->surface->geometry.height); + el->layer, el->visible, es->surfaceid, (int)es->surface, + es->visible, (int)es->surface->geometry.x, + (int)es->surface->geometry.y, es->surface->geometry.width, + es->surface->geometry.height); #endif } } @@ -1544,6 +1560,11 @@ uifw_set_positionsize(struct wl_client *client, struct wl_resource *resource, uifw_trace("uifw_set_positionsize: node=%d dose not exist(max=%d)", node, _ico_num_nodes); if ((ico_ivi_debugflag() & ICO_IVI_DEBUG_SHOW_SURFACE) == 0) { + if (usurf->visible) { + /* no display, change to hide */ + uifw_set_visible(client, resource, surfaceid, ICO_WINDOW_MGR_VISIBLE_HIDE, + ICO_WINDOW_MGR_V_NOCHANGE, 0); + } usurf->disable = 1; } node = 0; @@ -2260,7 +2281,7 @@ win_mgr_change_mapsurface(struct uifw_surface_map *sm, int event) { struct uifw_drm_buffer *drm_buffer; struct uifw_dri_image *dri_image; - struct uifw_dri_region *dri_region; + struct uifw_intel_region *dri_region; struct uifw_gl_surface_state *gl_state; struct weston_surface *es; uint32_t eglname = 0; @@ -2346,10 +2367,12 @@ win_mgr_change_mapsurface(struct uifw_surface_map *sm, int event) } if (event != 0) { +#if 0 /* too many log */ uifw_trace("win_mgr_change_mapsurface: send MAP event(ev=%d surf=%08x name=%08x " "w/h/s=%d/%d/%d format=%x", event, sm->usurf->surfaceid, sm->eglname, sm->width, sm->height, sm->stride, sm->format); +#endif ico_window_mgr_send_map_surface(sm->uclient->mgr->resource, event, sm->usurf->surfaceid, sm->type, sm->eglname, sm->width, sm->height, sm->stride, sm->format); @@ -2361,7 +2384,6 @@ win_mgr_change_mapsurface(struct uifw_surface_map *sm, int event) _ico_win_mgr->free_maptable = sm; } } - uifw_trace("win_mgr_change_mapsurface: Leave"); } /*--------------------------------------------------------------------------*/ diff --git a/tests/Makefile.am b/tests/Makefile.am index f024ebc..a86332c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,8 @@ test_send_event_SOURCES = test-send_event.c $(test_common_src) test_send_event_LDADD = $(SIMPLE_CLIENT_LIBS) $(test_wayland_client) test_homescreen_SOURCES = test-homescreen.c $(test_common_src) test-thumbnail.c -test_homescreen_LDADD = $(SIMPLE_CLIENT_LIBS) $(test_protocol_lib) $(test_wayland_client) +test_homescreen_CFLAGS = $(GCC_CFLAGS) $(EXT_CFLAGS) $(PLUGIN_CFLAGS) +test_homescreen_LDADD = $(SIMPLE_CLIENT_LIBS) $(test_protocol_lib) $(test_wayland_client) $(PLUGIN_LIBS) test_client_SOURCES = test-client.c $(test_common_src) test_client_LDADD = $(SIMPLE_CLIENT_LIBS) $(test_protocol_lib) $(test_wayland_client) diff --git a/tests/test-client.c b/tests/test-client.c index 3720301..6a383f8 100644 --- a/tests/test-client.c +++ b/tests/test-client.c @@ -577,6 +577,88 @@ clear_surface(struct display *display) } } +static void +set_region(struct display *display, char *buf) +{ + char *args[10]; + int narg; + int x, y, width, height; + int hot_x, hot_y; + int c_x, c_y, c_width, c_height; + + narg = pars_command(buf, args, 10); + if (narg >= 5) { + x = strtol(args[1], (char **)0, 0); + y = strtol(args[2], (char **)0, 0); + width = strtol(args[3], (char **)0, 0); + height = strtol(args[4], (char **)0, 0); + hot_x = x + (width / 2); + hot_y = y + (height / 2); + c_x = x + 5; + c_y = y + 5; + c_width = width - 10; + if (c_width <= 0) c_width = 2; + c_height = height - 10; + if (c_height <= 0) c_height = 2; + print_log("CLIENT: ico_exinput_set_input_region(%s,%d,%d-%d,%d," + "hot=%d,%d,cur=%d,%d-%d,%d,attr=0)", + args[0] ? args[0] : "(null)", x, y, width, height, + hot_x, hot_y, c_x, c_y, c_width, c_height); + if (strcasecmp(args[0], "NULL") == 0) { + ico_exinput_set_input_region(display->ico_exinput, "", x, y, + width, height, hot_x, hot_y, c_x, c_y, + c_width, c_height, 0); + } + else { + ico_exinput_set_input_region(display->ico_exinput, args[0], x, y, + width, height, hot_x, hot_y, c_x, c_y, + c_width, c_height, 0); + } + } + else { + print_log("CLIENT: set_region command[set_region winname@appid x y " + "width height] has no argument"); + } +} + +static void +unset_region(struct display *display, char *buf) +{ + char *args[10]; + int narg; + int x, y, width, height; + + narg = pars_command(buf, args, 10); + if (narg >= 1) { + if (narg >= 5) { + x = strtol(args[1], (char **)0, 0); + y = strtol(args[2], (char **)0, 0); + width = strtol(args[3], (char **)0, 0); + height = strtol(args[4], (char **)0, 0); + } + else { + x = 0; + y = 0; + width = 0; + height = 0; + } + print_log("CLIENT: ico_exinput_unset_input_region(%s,08x,%d,%d-%d,%d)", + args[0] ? args[0] : "(null)", x, y, width, height); + if (strcasecmp(args[0], "NULL") == 0) { + ico_exinput_unset_input_region(display->ico_exinput, "", x, y, + width, height); + } + else { + ico_exinput_unset_input_region(display->ico_exinput, args[0], + x, y, width, height); + } + } + else { + print_log("CLIENT: unset_region command[unset_region winname@appid x y " + "width height] has no argument"); + } +} + int main(int argc, char *argv[]) { struct display *display; @@ -663,6 +745,14 @@ int main(int argc, char *argv[]) display->init_color = strtoul(&buf[14], (char **)0, 0); clear_surface(display); } + else if (strncasecmp(buf, "set_region", 10) == 0) { + /* set input region */ + set_region(display, &buf[10]); + } + else if (strncasecmp(buf, "unset_region", 12) == 0) { + /* unset input region */ + unset_region(display, &buf[12]); + } else if (strncasecmp(buf, "send-state", ret) == 0) { send_state(display); } @@ -678,7 +768,7 @@ int main(int argc, char *argv[]) } else { print_log("CLIENT: unknown command[%s]", buf); - return(-1); + return -1; } } if (postsec > 0) { diff --git a/tests/test-common.c b/tests/test-common.c index 9f36fba..a85d765 100644 --- a/tests/test-common.c +++ b/tests/test-common.c @@ -63,7 +63,7 @@ getdata(void *window_mgr, const char *prompt, int fd, char *buf, const int size) ret = read(fd, &buf[i], 1); if (ret < 0) { - return(ret); + return ret; } if ((buf[i] == '\n') || (buf[i] == '\r')) break; @@ -94,7 +94,7 @@ getdata(void *window_mgr, const char *prompt, int fd, char *buf, const int size) strcpy( buf, &buf[j] ); i -= j; } - return(i); + return i; } /*--------------------------------------------------------------------------*/ @@ -130,6 +130,59 @@ print_log(const char *fmt, ...) (int)NowTime.tv_usec/1000, getpid(), log); } +/*--------------------------------------------------------------------------*/ +/** + * @brief skip_spaces: skip spaces in command input + * + * @param[in] buf input command string + * @return character pointer of not space character + */ +/*--------------------------------------------------------------------------*/ +char * +skip_spaces(char *buf) +{ + while ((*buf == ' ') || (*buf == '\t')) { + buf++; + } + return buf; +} + +/*--------------------------------------------------------------------------*/ +/** + * @brief pars_command: The word division of the command line + * + * @param[in] buf input command string + * @param[in] pt word pointers (maximum len words) + * @param[in] len maximum number of words + * @return number of words + */ +/*--------------------------------------------------------------------------*/ +int +pars_command(char *buf, char *pt[], const int len) +{ + char *p; + int narg; + + memset(pt, 0, sizeof(int *)*10); + p = buf; + for (narg = 0; narg < len; narg++) { + p = skip_spaces(p); + if (*p == 0) break; + pt[narg] = p; + for (; *p; p++) { + if ((*p == ' ') || (*p == '\t') || + (*p == '=') || (*p == ',')) break; + } + if (*p == 0) { + narg++; + break; + } + *p = 0; + p++; + } + return narg; +} + /*--------------------------------------------------------------------------*/ /** * @brief wayland_dispatch_nonblock: Read from wayland if receive data exist @@ -262,7 +315,7 @@ sec_str_2_value(const char *ssec) if (n == 2) msec *= 10; sec += msec; } - return(sec); + return sec; } /*--------------------------------------------------------------------------*/ @@ -331,7 +384,7 @@ opengl_init(struct wl_display *display, EGLConfig *rconf, EGLContext *rctx) wayland_dispatch_nonblock(display); - return(dpy); + return dpy; } /*--------------------------------------------------------------------------*/ @@ -375,7 +428,7 @@ opengl_create_window(struct wl_display *display, struct wl_surface *surface, opengl_swap_buffer(display, dpy, egl_surface); - return(egl_surface); + return egl_surface; } /*--------------------------------------------------------------------------*/ diff --git a/tests/test-common.h b/tests/test-common.h index e7b2bc2..9e646e0 100644 --- a/tests/test-common.h +++ b/tests/test-common.h @@ -37,6 +37,8 @@ /* Function prototype */ int getdata(void *window_mgr, const char *prompt, int fd, char *buf, const int size); void print_log(const char *fmt, ...); +char *skip_spaces(char *buf); +int pars_command(char *buf, char *pt[], const int len); void wayland_dispatch_nonblock(struct wl_display *display); void sleep_with_wayland(struct wl_display *display, int msec); void wait_with_wayland(struct wl_display *display, int msec, int *endflag); @@ -48,8 +50,8 @@ EGLSurface opengl_create_window(struct wl_display *display, struct wl_surface *s void opengl_clear_window(const unsigned int color); void opengl_swap_buffer(struct wl_display *display, EGLDisplay dpy, EGLSurface egl_surface); void opengl_thumbnail(struct wl_display *display, uint32_t surfaceid, EGLDisplay dpy, - EGLContext ctx, uint32_t name, int width, int height, int stride, - uint32_t format); + EGLConfig conf, EGLSurface egl_surface, EGLContext ctx, uint32_t name, + int width, int height, int stride, uint32_t format); #endif /*_TEST_COMMON_H_*/ diff --git a/tests/test-homescreen.c b/tests/test-homescreen.c index bd1f3ea..6d5da3f 100644 --- a/tests/test-homescreen.c +++ b/tests/test-homescreen.c @@ -46,6 +46,7 @@ #include #include "ico_window_mgr-client-protocol.h" #include "ico_input_mgr-client-protocol.h" +#include "ico_input_mgr.h" #include "test-common.h" #define MAX_APPID 128 @@ -481,10 +482,14 @@ search_surface(struct display *display, const char *surfname) } if (p) { - return(p->surfaceid); + return p->surfaceid; } else { - return(-1); + if ((strcasecmp(surfname, "all") == 0) || + (strcasecmp(surfname, "main") == 0)) { + return ICO_WINDOW_MGR_V_MAINSURFACE; + } + return -1; } } @@ -501,7 +506,7 @@ search_surfacename(struct display *display, const char *surfname) if (! p) { print_log("HOMESCREEN: app(%s) dose not exist", surfname); } - return(p); + return p; } static struct surface_name * @@ -512,11 +517,11 @@ search_surfaceid(struct display *display, const int surfaceid) p = display->surface_name; while (p) { if (p->surfaceid == surfaceid) { - return(p); + return p; } p = p->next; } - return(NULL); + return NULL; } static void @@ -720,7 +725,8 @@ window_map(void *data, struct ico_window_mgr *ico_window_mgr, if ((event == ICO_WINDOW_MGR_MAP_SURFACE_EVENT_MAP) || (event == ICO_WINDOW_MGR_MAP_SURFACE_EVENT_CONTENTS)) { opengl_thumbnail(display->display, surfaceid, display->surface->dpy, - display->surface->ctx, target, width, height, stride, format); + display->surface->conf, display->surface->egl_surface, + display->surface->ctx, target, width, height, stride, format); } } @@ -767,6 +773,56 @@ static const struct ico_exinput_listener exinput_listener = { cb_input_input }; +static void +cb_input_regions(void *data, struct ico_input_mgr_device *ico_input_mgr_device, + struct wl_array *regions) +{ + struct ico_uifw_input_region *region; + int n; + char schange[16]; + + n = 0; + if (regions) { + wl_array_for_each(region, regions) { + n ++; + print_log("HOMESCREEN: Event[input_regions] number of regions=%d", n); + } + n = 0; + wl_array_for_each(region, regions) { + n ++; + switch (region->change) { + case ICO_INPUT_MGR_DEVICE_REGION_ADD: + strcpy(schange, "Add"); + break; + case ICO_INPUT_MGR_DEVICE_REGION_REMOVE: + strcpy(schange, "Remove"); + break; + case ICO_INPUT_MGR_DEVICE_REGION_REMOVEALL: + strcpy(schange, "RemoveAll"); + break; + default: + sprintf(schange, "?%d?", region->change); + break; + } + print_log("HOMESCREEN:%2d. %s %d.%08(%d/%d) &d/%d-%d/%d " + "hot=%d/%d cur=%d/%d-%d/%d attr=%x", + n, schange, region->node, region->surfaceid, region->surface_x, + region->surface_y, region->x, region->y, region->width, + region->height, region->hotspot_x, region->hotspot_y, + region->cursor_x, region->cursor_y, region->cursor_width, + region->cursor_height, region->attr); + } + } + else { + print_log("HOMESCREEN: Event[input_regions] no region"); + } +} + +static const struct ico_input_mgr_device_listener device_listener = { + cb_input_regions +}; + + static void handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) @@ -824,6 +880,8 @@ handle_global(void *data, struct wl_registry *registry, uint32_t id, else if (strcmp(interface, "ico_input_mgr_device") == 0) { display->ico_input_device = wl_registry_bind(display->registry, id, &ico_input_mgr_device_interface, 1); + ico_input_mgr_device_add_listener(display->ico_input_device, + &device_listener, display); print_log("HOMESCREEN: created input_device global %p", display->ico_input_device); } else if (strcmp(interface, "ico_exinput") == 0) { @@ -843,41 +901,6 @@ static const struct wl_registry_listener registry_listener = { handle_global }; -static char * -skip_spaces(char *buf) -{ - while ((*buf == ' ') || (*buf == '\t')) { - buf++; - } - return(buf); -} - -static int -pars_command(char *buf, char *pt[], const int len) -{ - char *p; - int narg; - - memset(pt, 0, sizeof(int *)*10); - p = buf; - for (narg = 0; narg < len; narg++) { - p = skip_spaces(p); - if (*p == 0) break; - pt[narg] = p; - for (; *p; p++) { - if ((*p == ' ') || (*p == '\t') || - (*p == '=') || (*p == ',')) break; - } - if (*p == 0) { - narg++; - break; - } - *p = 0; - p++; - } - return (narg); -} - static void launch_app(struct display *display, char *buf) { @@ -1695,6 +1718,88 @@ send_event(const char *cmd) } } +static void +set_region(struct display *display, char *buf) +{ + char *args[10]; + int narg; + int x, y, width, height; + int hot_x, hot_y; + int c_x, c_y, c_width, c_height; + + narg = pars_command(buf, args, 10); + if (narg >= 5) { + x = strtol(args[1], (char **)0, 0); + y = strtol(args[2], (char **)0, 0); + width = strtol(args[3], (char **)0, 0); + height = strtol(args[4], (char **)0, 0); + hot_x = x + (width / 2); + hot_y = y + (height / 2); + c_x = x + 5; + c_y = y + 5; + c_width = width - 10; + if (c_width <= 0) c_width = 2; + c_height = height - 10; + if (c_height <= 0) c_height = 2; + print_log("HOMESCREEN: ico_exinput_set_input_region(%s,%d,%d-%d,%d," + "hot=%d,%d,cur=%d,%d-%d,%d,attr=0)", + args[0] ? args[0] : "(null)", x, y, width, height, + hot_x, hot_y, c_x, c_y, c_width, c_height); + if (strcasecmp(args[0], "NULL") == 0) { + ico_exinput_set_input_region(display->ico_exinput, "", x, y, + width, height, hot_x, hot_y, c_x, c_y, + c_width, c_height, 0); + } + else { + ico_exinput_set_input_region(display->ico_exinput, args[0], x, y, + width, height, hot_x, hot_y, c_x, c_y, + c_width, c_height, 0); + } + } + else { + print_log("HOMESCREEN: set_region command[set_region winname@appid x y " + "width height] has no argument"); + } +} + +static void +unset_region(struct display *display, char *buf) +{ + char *args[10]; + int narg; + int x, y, width, height; + + narg = pars_command(buf, args, 10); + if (narg >= 1) { + if (narg >= 5) { + x = strtol(args[1], (char **)0, 0); + y = strtol(args[2], (char **)0, 0); + width = strtol(args[3], (char **)0, 0); + height = strtol(args[4], (char **)0, 0); + } + else { + x = 0; + y = 0; + width = 0; + height = 0; + } + print_log("HOMESCREEN: ico_exinput_unset_input_region(%s,08x,%d,%d-%d,%d)", + args[0] ? args[0] : "(null)", x, y, width, height); + if (strcasecmp(args[0], "NULL") == 0) { + ico_exinput_unset_input_region(display->ico_exinput, "", x, y, + width, height); + } + else { + ico_exinput_unset_input_region(display->ico_exinput, args[0], + x, y, width, height); + } + } + else { + print_log("HOMESCREEN: unset_region command[unset_region winname@appid x y " + "width height] has no argument"); + } +} + /* * Main Program * @@ -1856,6 +1961,18 @@ int main(int argc, char *argv[]) /* input switch event */ input_sw(display, &buf[8]); } + else if (strncasecmp(buf, "set_region", 10) == 0) { + /* set input region */ + set_region(display, &buf[10]); + } + else if (strncasecmp(buf, "unset_region", 12) == 0) { + /* unset input region */ + unset_region(display, &buf[12]); + } + else if (strncasecmp(buf, "input_sw", 8) == 0) { + /* input switch event */ + input_sw(display, &buf[8]); + } else if (strncasecmp(buf, "sleep", 5) == 0) { /* Sleep */ msec = sec_str_2_value(&buf[6]); @@ -1885,6 +2002,6 @@ int main(int argc, char *argv[]) send_event(NULL); - return(0); + return 0; } diff --git a/tests/test-thumbnail.c b/tests/test-thumbnail.c index 0677835..e41ed62 100644 --- a/tests/test-thumbnail.c +++ b/tests/test-thumbnail.c @@ -30,53 +30,6 @@ #include #include #include "test-common.h" -#include -#include - -/* wl_buffer (inport from wayland-1.2.0/src/wayland-server.h) */ -struct uifw_wl_buffer { - struct wl_resource resource; - int32_t width, height; - uint32_t busy_count; -}; - -/* wl_drm (inport from mesa-9.1.3/src/egl/wayland/wayland-drm/wayland-drm.c) */ -struct uifw_drm { - struct wl_display *display; - void *user_data; - char *device_name; - void *callbacks; -}; - -/* wl_drm_buffer (inport from mesa-9.1.3/src/egl/wayland/wayland-drm/wayland-drm.h) */ -struct uifw_drm_buffer { - struct uifw_wl_buffer buffer; - struct uifw_drm *drm; /* struct wl_drm */ - uint32_t format; - const void *driver_format; - int32_t offset[3]; - int32_t stride[3]; - void *driver_buffer; -}; - -/* buffer management table */ -struct _egl_buffer { - struct _egl_buffer *next; - uint32_t surfaceid; - uint32_t target; - struct uifw_drm_buffer buffer; -}; - -#if 0 /* not yet support */ -static struct _egl_buffer *egl_buffer = NULL; -static struct uifw_drm drm = { NULL }; - -/* EGL functions */ -static PFNEGLQUERYWAYLANDBUFFERWL query_buffer = NULL; -static PFNEGLCREATEIMAGEKHRPROC create_image = NULL; -static PFNEGLDESTROYIMAGEKHRPROC destroy_image = NULL; -static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d = NULL; -#endif /*--------------------------------------------------------------------------*/ /** @@ -96,80 +49,9 @@ static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d = NULL; /*--------------------------------------------------------------------------*/ void opengl_thumbnail(struct wl_display *display, uint32_t surfaceid, EGLDisplay dpy, - EGLContext ctx, uint32_t target, int width, int height, - int stride, uint32_t format) + EGLConfig conf, EGLSurface egl_surface, EGLContext ctx, + uint32_t target, int width, int height, int stride, uint32_t format) { -#if 0 /* not yet support */ - struct _egl_buffer *buffer; /* EGL buffer management table */ - GLuint texture; /* texture */ - EGLImageKHR image; /* image */ - EGLint attribs[3]; /* attributes */ - - /* search created buffers */ - if (! egl_buffer) { - memset(&drm, 0, sizeof(drm)); - drm.display = wl_display; - drm.device_name = "intel"; - } - buffer = egl_buffer; - while(buffer) { - if ((buffer->surfaceid == surfaceid) && - (buffer->target == target)) break; - } - if (! buffer) { - /* create new buffer */ - buffer = malloc(sizeof(struct _egl_buffer)); - if (! buffer) { - print_log("opengl_thumbnail: ERROR can not alloc buffer table"); - return; - } - memset(buffer, 0, sizeof(struct _egl_buffer)); - buffer->next = egl_buffer; - egl_buffer = buffer; - - buffer->buffer.width = width; - buffer->buffer.height = height; - buffer->drm = &drm; - buffer->format = format; - } - - if (! query_buffer) { - query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); - create_image = (void *) eglGetProcAddress("eglCreateImageKHR"); - destory_image = (void *) eglGetProcAddress("eglDestroyImageKHR"); - image_target_texture_2d = (void *) eglGetProcAddress("glEGLImageTargetTexture2DOES"); - - if ((! query_buffer) || (! create_image) || - (! destory_image) || (! image_target_texture_2d)) { - print_log("opengl_thumbnail: ERROR can not get EGL extension cwfunctions"); - query_buffer = NULL; - return; - } - } - - /* get image from EGL buffer */ - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindTexture(GL_TEXTURE_2D, 0); - - attribs[0] = EGL_WAYLAND_PLANE_WL; - attribs[1] = 0; - attribs[2] = EGL_NONE; - image = create_image(dpy, NULL, EGL_WAYLAND_BUFFER_WL, egl_buffers[idx].buffer, attribs); - if (! image) { - print_log("opengl_thumbnail: ERROR can not create image"); - return; - } - - /* create texture from image */ - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, texture); - image_target_texture_2d(GL_TEXTURE_2D, image); - - /* texture to surface */ - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); -#endif + print_log("opengl_thumbnail: Not support."); } diff --git a/tests/testdata/cl_inputregion.dat b/tests/testdata/cl_inputregion.dat new file mode 100644 index 0000000..8ffdcad --- /dev/null +++ b/tests/testdata/cl_inputregion.dat @@ -0,0 +1,47 @@ +# Test for Weston IVI Plugin for Native Application +# Surface Create and Exit +# +# 1. Create Surface +create-surface +sleep 0.5 +set_region @test-client 50 100 30 60 +# 2. Sleep 1 sec with color change +sleep 0.5 +clear-surface 0x80ff2020 +sleep 0.5 +clear-surface 0xb020ff20 +sleep 0.5 +# +unset_region @test-client +# +clear-surface 0xe02020ff +sleep 0.5 +clear-surface 0xff808080 +sleep 0.5 +clear-surface 0x80ff2020 +sleep 0.5 +clear-surface 0xb020ff20 +sleep 0.5 +clear-surface 0xe02020ff +sleep 0.5 +clear-surface 0xff808080 +sleep 0.5 +clear-surface 0x80ff2020 +sleep 0.5 +clear-surface 0xb020ff20 +sleep 0.5 +clear-surface 0xe02020ff +sleep 0.5 +clear-surface 0xff808080 +sleep 0.5 +clear-surface 0x80ff2020 +sleep 0.5 +clear-surface 0xb020ff20 +sleep 0.5 +clear-surface 0xe02020ff +sleep 0.5 +clear-surface 0xff808080 +sleep 30 +# 3. End of this Application (exit) +bye + diff --git a/tests/testdata/hs_inputregion.dat b/tests/testdata/hs_inputregion.dat new file mode 100644 index 0000000..e7579a6 --- /dev/null +++ b/tests/testdata/hs_inputregion.dat @@ -0,0 +1,40 @@ +# Test for Weston IVI Plugin for HomeScreen(SystemController) +# Input region Test +# +# +# 1. Make surfaces +# +launch ../tests/test-client < ../tests/testdata/cl_inputregion.dat 2> ../tests/testlog/test-client01.log 1>&2 +waitcreate 2 +show test-client +sleep 1 +# set region +## set_region test-client@test-client 50 100 30 60 # request from application +set_region test-client@test-client 70 200 50 80 +sleep 1 +# unset region +## unset_region test-client@test-client 50 100 30 60 # request from application +unset_region test-client@ 70 200 50 80 +sleep 1 +# +launch ../tests/test-eflapp @1 -color=0xe02040ff 2> ../tests/testlog/test-eflapp.log 1>&2 +waitcreate 2 +move test-eflapp@1 100 150 +show test-eflapp@1 +sleep 1 +# +# set region +set_region test-eflapp@@1@test-eflapp@@1 60 90 40 70 +set_region test-eflapp@@1@test0eflapp@@1 80 190 60 100 +sleep 1 +# unset region +unset_region test-eflapp@@1 main 0 0 0 0 +# +sleep 2 +kill test-client +kill test-eflapp@1 +sleep 1 +# +# 2. End of Test +bye + diff --git a/tests/weston-plugin-test b/tests/weston-plugin-test index 65f0d3f..97e21b7 100755 --- a/tests/weston-plugin-test +++ b/tests/weston-plugin-test @@ -12,34 +12,28 @@ rm -fr ../tests/testlog/* 2> /dev/null ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & sleep 1 -# 3 Weston/Wayland Envionment -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl -export XDG_RUNTIME_DIR=/run/user/5000 - -# 4 Set Environment for Test +# 3 Set Environment for Test export WESTON_IVI_PLUGIN_DIR="../src/.libs" -# 5 Start Weston +# 4 Start Weston export XDG_CONFIG_HOME="../tests" MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & sleep 1 -# 6 Set library path +# 5 Set library path export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH -# 7 Start test-homescreen +# 6 Start test-homescreen ../tests/test-homescreen < ../tests/testdata/hs_alltest.dat 2> ../tests/testlog/test-homescreen.log 1>&2 -# 8 End of Test +# 7 End of Test sleep 2 /usr/bin/killall weston /usr/bin/killall test-send_event sleep 1 -# 9 Check Error +# 8 Check Error FOUND_ERR=0 /bin/grep "ERR>" testlog/* if [ "$?" != "1" ] ; then diff --git a/tests/weston-plugin-test.anima b/tests/weston-plugin-test.anima index bd99581..f88ef14 100755 --- a/tests/weston-plugin-test.anima +++ b/tests/weston-plugin-test.anima @@ -12,34 +12,28 @@ rm -fr ../tests/testlog/* 2> /dev/null ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & sleep 1 -# 3 Weston/Wayland Envionment -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl -export XDG_RUNTIME_DIR=/run/user/5000 - -# 4 Set Environment for Test +# 3 Set Environment for Test export WESTON_IVI_PLUGIN_DIR="../src/.libs" -# 5 Start Weston +# 4 Start Weston export XDG_CONFIG_HOME="../tests" MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & sleep 1 -# 6 Set library path +# 5 Set library path export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH -# 7 Start test-homescreen +# 6 Start test-homescreen ../tests/test-homescreen < ../tests/testdata/hs_animatest.dat 2> ../tests/testlog/test-homescreen.log -# 8 End of Test +# 7 End of Test sleep 2 /usr/bin/killall weston /usr/bin/killall test-send_event sleep 1 -# 9 Check Error +# 8 Check Error FOUND_ERR=0 /bin/grep "ERR>" testlog/* if [ "$?" != "1" ] ; then diff --git a/tests/weston-plugin-test.homescreen b/tests/weston-plugin-test.homescreen deleted file mode 100755 index 77b6478..0000000 --- a/tests/weston-plugin-test.homescreen +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test -# Examination to operate only the program of the HomeScreen. -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 3 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 4 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 2 - -# 5 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 6 Start test-homescreen -../tests/test-homescreen -prompt=1 2> ../tests/testlog/test-homescreen.log - -# 7 End of Test -sleep 2 -/usr/bin/killall weston - diff --git a/tests/weston-plugin-test.input b/tests/weston-plugin-test.input index f669462..2a56604 100755 --- a/tests/weston-plugin-test.input +++ b/tests/weston-plugin-test.input @@ -12,34 +12,28 @@ mkdir ../tests/testlog ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & sleep 1 -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test +# 3 Set Environment for Test export WESTON_IVI_PLUGIN_DIR="../src/.libs" -# 5 Start Weston +# 4 Start Weston export XDG_CONFIG_HOME="../tests" MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & sleep 1 -# 6 Set library path +# 5 Set library path export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH -# 7 Start test-homescreen +# 6 Start test-homescreen ../tests/test-homescreen < ../tests/testdata/hs_inputtest.dat 2> ../tests/testlog/test-homescreen.log -# 8 End of Test +# 7 End of Test sleep 1 /usr/bin/killall weston /usr/bin/killall test-send_event sleep 1 -# 9 Check Error +# 8 Check Error FOUND_ERR=0 /bin/grep "ERR>" testlog/* if [ "$?" != "1" ] ; then diff --git a/tests/weston-plugin-test.map b/tests/weston-plugin-test.map index 6240293..83af7b2 100755 --- a/tests/weston-plugin-test.map +++ b/tests/weston-plugin-test.map @@ -12,34 +12,28 @@ rm -fr ../tests/testlog/* 2> /dev/null ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & sleep 1 -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test +# 3 Set Environment for Test export WESTON_IVI_PLUGIN_DIR="../src/.libs" -# 5 Start Weston +# 4 Start Weston export XDG_CONFIG_HOME="../tests" MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & sleep 1 -# 6 Set library path +# 5 Set library path export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH -# 7 Start test-homescreen +# 6 Start test-homescreen ../tests/test-homescreen < ../tests/testdata/hs_mapsurf.dat 2> ../tests/testlog/test-homescreen.log -# 8 End of Test +# 7 End of Test sleep 2 /usr/bin/killall weston /usr/bin/killall test-send_event sleep 1 -# 9 Check Error +# 8 Check Error FOUND_ERR=0 /bin/grep "ERR>" testlog/* if [ "$?" != "1" ] ; then diff --git a/tests/weston-plugin-test.notouch b/tests/weston-plugin-test.notouch deleted file mode 100755 index 63bc6ae..0000000 --- a/tests/weston-plugin-test.notouch +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Start Pseudo event device (for Touch Panel) -#../tests/test-send_event -mq=5551 & -#sleep 1 - -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 5 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 6 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 7 Start test-homescreen -../tests/test-homescreen < ../tests/testdata/hs_alltest.dat 2> ../tests/testlog/test-homescreen.log - -# 8 End of Test -sleep 1 -/usr/bin/killall weston -/usr/bin/killall test-send_event -sleep 1 - -# 9 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - diff --git a/tests/weston-plugin-test.region b/tests/weston-plugin-test.region new file mode 100755 index 0000000..59ef8d6 --- /dev/null +++ b/tests/weston-plugin-test.region @@ -0,0 +1,64 @@ +#!/bin/sh +# +# Weston IVI Plugin Test +# +# Remark: This examination premises that Weston does not run. + +# 1 Delete log file +mkdir ../tests/testlog 2> /dev/null +rm -fr ../tests/testlog/* 2> /dev/null + +# 2 Start Pseudo event device (for Touch Panel) +../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & +sleep 1 + +# 3 Set Environment for Test +export WESTON_IVI_PLUGIN_DIR="../src/.libs" + +# 4 Start Weston +export XDG_CONFIG_HOME="../tests" +MOD_DIR="$PWD/../src/.libs" +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & +sleep 1 + +# 5 Set library path +export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH + +# 6 Start test-homescreen +../tests/test-homescreen < ../tests/testdata/hs_inputregion.dat 2> ../tests/testlog/test-homescreen.log + +# 7 End of Test +sleep 2 +/usr/bin/killall weston +/usr/bin/killall test-send_event +sleep 1 + +# 9 Check Error +FOUND_ERR=0 +/bin/grep "ERR>" testlog/* +if [ "$?" != "1" ] ; then + FOUND_ERR=1 +fi +/bin/grep "WRN>" testlog/* +if [ "$?" != "1" ] ; then + FOUND_ERR=1 +fi +/bin/grep "Error" testlog/* +if [ "$?" != "1" ] ; then + FOUND_ERR=1 +fi +/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" +if [ "$?" != "1" ] ; then + FOUND_ERR=1 +fi +/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" +if [ "$?" != "1" ] ; then + FOUND_ERR=1 +fi + +if [ $FOUND_ERR = 0 ] ; then + echo "Weston IVI Plugin Test: OK" +else + echo "Weston IVI Plugin Test: ERROR" +fi + diff --git a/tests/weston-plugin-test.resize b/tests/weston-plugin-test.resize index 2e73bd2..4bbb1ce 100755 --- a/tests/weston-plugin-test.resize +++ b/tests/weston-plugin-test.resize @@ -12,34 +12,28 @@ rm -fr ../tests/testlog/* 2> /dev/null ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & sleep 1 -# 3 Weston/Wayland Envionment -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl -export XDG_RUNTIME_DIR=/run/user/5000 - -# 4 Set Environment for Test +# 3 Set Environment for Test export WESTON_IVI_PLUGIN_DIR="../src/.libs" -# 5 Start Weston +# 4 Start Weston export XDG_CONFIG_HOME="../tests" MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & sleep 1 -# 6 Set library path +# 5 Set library path export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH -# 7 Start test-homescreen +# 6 Start test-homescreen ../tests/test-homescreen < ../tests/testdata/hs_resize.dat 2> ../tests/testlog/test-homescreen.log 1>&2 -# 8 End of Test +# 7 End of Test sleep 2 /usr/bin/killall weston /usr/bin/killall test-send_event sleep 1 -# 9 Check Error +# 8 Check Error FOUND_ERR=0 /bin/grep "ERR>" testlog/* if [ "$?" != "1" ] ; then diff --git a/tests/weston-plugin-test.resize_flower b/tests/weston-plugin-test.resize_flower deleted file mode 100755 index 10f5cb2..0000000 --- a/tests/weston-plugin-test.resize_flower +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test (Resize Buf test) -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Start Pseudo event device (for Touch Panel) -../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & -sleep 1 - -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 5 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 6 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 7 Start test-homescreen -../tests/test-homescreen < ../tests/testdata/hs_resize_flower.dat 2> ../tests/testlog/test-homescreen.log - -# 8 End of Test -sleep 1 -/usr/bin/killall weston -/usr/bin/killall test-send_event -sleep 1 - -# 9 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - diff --git a/tests/weston-plugin-test.resize_native b/tests/weston-plugin-test.resize_native deleted file mode 100755 index acb37d3..0000000 --- a/tests/weston-plugin-test.resize_native +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test (Resize Buf test) -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Start Pseudo event device (for Touch Panel) -../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & -sleep 1 - -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 5 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 6 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 7 Start test-homescreen -../tests/test-homescreen < ../tests/testdata/hs_resize_native.dat 2> ../tests/testlog/test-homescreen.log - -# 8 End of Test -sleep 1 -/usr/bin/killall weston -/usr/bin/killall test-send_event -sleep 1 - -# 9 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - diff --git a/tests/weston-plugin-test.resize_smoke b/tests/weston-plugin-test.resize_smoke deleted file mode 100755 index 813f9c8..0000000 --- a/tests/weston-plugin-test.resize_smoke +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test (Resize Buf test) -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Start Pseudo event device (for Touch Panel) -../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & -sleep 1 - -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 5 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 6 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 7 Start test-homescreen -if [ $# != 0 ] ; then - ../tests/test-homescreen < ../tests/testdata/$1 2> ../tests/testlog/test-homescreen.log -else - ../tests/test-homescreen < ../tests/testdata/hs_resize_smoke.dat 2> ../tests/testlog/test-homescreen.log -fi - -# 8 End of Test -sleep 1 -/usr/bin/killall weston -/usr/bin/killall test-send_event -sleep 1 - -# 9 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - diff --git a/tests/weston-plugin-test.resize_smoke2 b/tests/weston-plugin-test.resize_smoke2 deleted file mode 100755 index 614dc67..0000000 --- a/tests/weston-plugin-test.resize_smoke2 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test (Resize Buf test) -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Start Pseudo event device (for Touch Panel) -../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & -sleep 1 - -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 5 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 6 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 7 Start test-homescreen -../tests/test-homescreen < ../tests/testdata/hs_resize_smoke2.dat 2> ../tests/testlog/test-homescreen.log - -# 8 End of Test -sleep 1 -/usr/bin/killall weston -/usr/bin/killall test-send_event -sleep 1 - -# 9 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - diff --git a/tests/weston-plugin-test.send_input b/tests/weston-plugin-test.send_input index 5039f68..28e5afa 100755 --- a/tests/weston-plugin-test.send_input +++ b/tests/weston-plugin-test.send_input @@ -12,34 +12,28 @@ rm -fr ../tests/testlog/* 2> /dev/null ../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & sleep 1 -# 3 Weston/Wayland Envionment -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl -export XDG_RUNTIME_DIR=/run/user/5000 - -# 4 Set Environment for Test +# 3 Set Environment for Test export WESTON_IVI_PLUGIN_DIR="../src/.libs" -# 5 Start Weston +# 4 Start Weston export XDG_CONFIG_HOME="../tests" MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & +/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log & sleep 1 -# 6 Set library path +# 5 Set library path export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH -# 7 Start test-homescreen +# 6 Start test-homescreen ../tests/test-homescreen < ../tests/testdata/hs_sendinput.dat 2> ../tests/testlog/test-homescreen.log -# 8 End of Test +# 7 End of Test sleep 2 /usr/bin/killall weston /usr/bin/killall test-send_event sleep 1 -# 9 Check Error +# 8 Check Error FOUND_ERR=0 /bin/grep "ERR>" testlog/* if [ "$?" != "1" ] ; then diff --git a/tests/weston-plugin-test.slide b/tests/weston-plugin-test.slide deleted file mode 100755 index 75c771b..0000000 --- a/tests/weston-plugin-test.slide +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test (Resize Buf test) -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -if [ -d ../tests/testlog ] ; then - rm -fr ../tests/testlog/* -else - mkdir ../tests/testlog -fi - -# 2 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 3 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 4 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 5 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 6 Start test-homescreen -../tests/test-homescreen < ../tests/testdata/hs_slide.dat 2> ../tests/testlog/test-homescreen.log - -# 7 End of Test -sleep 1 -/usr/bin/killall weston -sleep 1 - -# 8 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - diff --git a/tests/weston-plugin-test_gdb b/tests/weston-plugin-test_gdb deleted file mode 100755 index a3b2c6e..0000000 --- a/tests/weston-plugin-test_gdb +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh -# -# Weston IVI Plugin Test -# -# Remark: This examination premises that Weston does not run. - -# 1 Delete log file -rm -fr ../tests/testlog -mkdir ../tests/testlog - -# 2 Start Pseudo event device (for Touch Panel) -../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log & -sleep 1 - -# 3 Weston/Wayland Envionment -export XDG_RUNTIME_DIR=/run/user/5000 -export QT_QPA_PLATFORM=wayland -export ELM_ENGINE=wayland_egl -export ECORE_EVAS_ENGINE=wayland_egl - -# 4 Set Environment for Test -export WESTON_IVI_PLUGIN_DIR="../src/.libs" - -# 5 Start Weston -export XDG_CONFIG_HOME="../tests" -MOD_DIR="$PWD/../src/.libs" -/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log & -sleep 1 - -# 6 Set library path -export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH - -# 7 Start test-homescreen -gdb ../tests/test-homescreen -../tests/test-homescreen < ../tests/testdata/hs_inputtest.dat 2> ../tests/testlog/test-homescreen.log - -# 8 End of Test -sleep 1 -/usr/bin/killall weston -/usr/bin/killall test-send_event -sleep 1 - -# 9 Check Error -FOUND_ERR=0 -/bin/grep "ERR>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "WRN>" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Error" testlog/* -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi -/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" -if [ "$?" != "1" ] ; then - FOUND_ERR=1 -fi - -if [ $FOUND_ERR = 0 ] ; then - echo "Weston IVI Plugin Test: OK" -else - echo "Weston IVI Plugin Test: ERROR" -fi - -- cgit v1.2.3