Page MenuHomePhabricator

Write test cases for Ecore_Wl2 API
Open, NormalPublic


After the API has been discussed, fixed and stabilized, we should write test cases for any API that we are going to expose to public.

Managed APIs LIST

  • ecore_wl2_display_compositor_version_get(disp);
  • ecore_wl2_display_connect(name);
  • ecore_wl2_display_create(name);
  • ecore_wl2_display_destroy(display);
  • ecore_wl2_display_disconnect(display);
  • ecore_wl2_display_dmabuf_get(display);
  • ecore_wl2_display_flush(display); @myoungwoon
  • ecore_wl2_display_get(display);
  • ecore_wl2_display_globals_get(display);
  • ecore_wl2_display_input_find(const display, unsigned id); @myoungwoon
  • ecore_wl2_display_input_find_by_name(const display, name); @myoungwoon
  • ecore_wl2_display_inputs_get(display);
  • ecore_wl2_display_name_get(const display);
  • ecore_wl2_display_registry_get(display);
  • ecore_wl2_display_screen_size_get(display, *w, *h);
  • ecore_wl2_display_shm_get(display);
  • ecore_wl2_display_sync_is_done(const display); @myoungwoon
  • ecore_wl2_display_terminate(display); @myoungwoon
  • ecore_wl2_dnd_drag_end(input); @myoungwoon
  • ecore_wl2_dnd_drag_start(input, window, drag_window); @myoungwoon
  • ecore_wl2_dnd_drag_types_set(input, *types); @myoungwoon
  • ecore_wl2_dnd_selection_clear(input); @myoungwoon
  • ecore_wl2_dnd_selection_get(input); @myoungwoon
  • ecore_wl2_dnd_selection_set(input, *types); @myoungwoon
  • ecore_wl2_dnd_set_actions(input); @myoungwoon
  • ecore_wl2_init();
  • ecore_wl2_input_cursor_from_name_set(input, cursor); @myoungwoon
  • ecore_wl2_input_display_get(const input);
  • ecore_wl2_input_keyboard_repeat_get(const input, double *rate, double *delay); @myoungwoon
  • ecore_wl2_input_keymap_get(const input);
  • ecore_wl2_input_name_get(input);
  • ecore_wl2_input_pointer_set(input, surface, hot_x, hot_y); @myoungwoon
  • ecore_wl2_input_pointer_xy_get(const input, *x, *y); @myoungwoon
  • ecore_wl2_input_seat_capabilities_get(input); @myoungwoon
  • ecore_wl2_input_seat_device_get(const input, const window); @myoungwoon
  • ecore_wl2_input_seat_get(input);
  • ecore_wl2_input_seat_id_get(input) EINA_WARN_UNUSED_RESULT;
  • ecore_wl2_offer_accept(Ecore_Wl2_Offer *offer, mime_type); @eagleeye
  • ecore_wl2_offer_action_get(Ecore_Wl2_Offer *offer); @eagleeye
  • ecore_wl2_offer_actions_get(Ecore_Wl2_Offer *offer); @eagleeye
  • ecore_wl2_offer_actions_set(Ecore_Wl2_Offer *offer, Ecore_Wl2_Drag_Action actions, Ecore_Wl2_Drag_Action action); @eagleeye
  • ecore_wl2_offer_finish(Ecore_Wl2_Offer *offer); @eagleeye
  • ecore_wl2_offer_mimes_get(Ecore_Wl2_Offer *offer); @eagleeye
  • ecore_wl2_offer_mimes_set(Ecore_Wl2_Offer *offer, Eina_Array *mimes); @eagleeye
  • ecore_wl2_offer_proxy_receive(Ecore_Wl2_Offer *offer, mime, fd); @eagleeye
  • ecore_wl2_offer_proxy_receive_end(Ecore_Wl2_Offer *offer); @eagleeye
  • ecore_wl2_offer_receive(Ecore_Wl2_Offer *offer, char *mime); @eagleeye
  • ecore_wl2_offer_supports_mime(Ecore_Wl2_Offer *offer, mime); @eagleeye
  • ecore_wl2_output_dpi_get(Ecore_Wl2_Output *output); @eagleeye
  • ecore_wl2_output_transform_get(Ecore_Wl2_Output *output); @eagleeye
  • ecore_wl2_session_recovery_disable(); ?? @eagleeye
  • ecore_wl2_shutdown();
  • ecore_wl2_subsurface_del(Ecore_Wl2_Subsurface *subsurface); @eagleeye
  • ecore_wl2_subsurface_new(window); @eagleeye
  • ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, x, y, w, h); @eagleeye
  • ecore_wl2_subsurface_place_above(Ecore_Wl2_Subsurface *subsurface, surface); @eagleeye
  • ecore_wl2_subsurface_place_below(Ecore_Wl2_Subsurface *subsurface, surface); @eagleeye
  • ecore_wl2_subsurface_position_get(Ecore_Wl2_Subsurface *subsurface, *x, *y); @eagleeye
  • ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, x, y); @eagleeye
  • ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *subsurface); @eagleeye
  • ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, sync); @eagleeye
  • ecore_wl2_window_activated_get(const window); @CHAN
  • ecore_wl2_window_alpha_get(window);
  • ecore_wl2_window_alpha_set(window, alpha);
  • ecore_wl2_window_aspect_set(window, w, h, unsigned aspect); ?? @CHAN
  • ecore_wl2_window_aux_hint_add(window, id, h, val); @CHAN
  • ecore_wl2_window_aux_hint_change(window, id, val); @CHAN
  • ecore_wl2_window_aux_hint_del(window, id); @CHAN
  • ecore_wl2_window_aux_hints_supported_get(window);
  • ecore_wl2_window_available_rotations_get(window, **rots, unsigned *count); @CHAN
  • ecore_wl2_window_available_rotations_set(window, const *rots, unsigned count); @CHAN
  • ecore_wl2_window_buffer_attach(win, *buffer, x, y, implicit); @CHAN
  • ecore_wl2_window_buffer_transform_set(window, transform); @CHAN
  • ecore_wl2_window_class_set(window, clas); ?? @CHAN
  • ecore_wl2_window_commit(window, flush); @CHAN
  • ecore_wl2_window_display_get(const window);
  • ecore_wl2_window_floating_mode_get(window);
  • ecore_wl2_window_floating_mode_set(window, floating);
  • ecore_wl2_window_focus_skip_get(window);
  • ecore_wl2_window_focus_skip_set(window, focus_skip);
  • ecore_wl2_window_frame_callback_add(window, Ecore_Wl2_Frame_Cb cb, *data); @CHAN
  • ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle); @CHAN
  • ecore_wl2_window_free(window); @CHAN
  • ecore_wl2_window_fullscreen_get(window);
  • ecore_wl2_window_fullscreen_set(window, fullscreen);
  • ecore_wl2_window_geometry_get(window, *x, *y, *w, *h);
  • ecore_wl2_window_geometry_set(window, x, y, w, h);
  • ecore_wl2_window_hide(window); @CHAN
  • ecore_wl2_window_iconified_set(window, iconified); @CHAN
  • ecore_wl2_window_input_region_set(window, x, y, w, h); @CHAN
  • ecore_wl2_window_maximized_get(window);
  • ecore_wl2_window_maximized_set(window, maximized);
  • ecore_wl2_window_move(window, input); @CHAN
  • ecore_wl2_window_new(display, parent, x, y, w, h);
  • ecore_wl2_window_opaque_region_set(window, x, y, w, h); @CHAN
  • ecore_wl2_window_output_find(window);
  • ecore_wl2_window_pending_get(window); @CHAN
  • ecore_wl2_window_popup_input_set(window, input); @CHAN
  • ecore_wl2_window_preferred_rotation_get(window);
  • ecore_wl2_window_preferred_rotation_set(window, rot);
  • ecore_wl2_window_resize(window, input, location); @CHAN
  • ecore_wl2_window_resizing_get(window); @CHAN
  • ecore_wl2_window_role_set(window, role); ?? @CHAN
  • ecore_wl2_window_rotation_app_get(window);
  • ecore_wl2_window_rotation_app_set(window, set);
  • ecore_wl2_window_rotation_get(window);
  • ecore_wl2_window_rotation_set(window, rotation);
  • ecore_wl2_window_shell_surface_exists(win); @CHAN
  • ecore_wl2_window_show(window); @CHAN
  • ecore_wl2_window_surface_get(window);
  • ecore_wl2_window_surface_id_get(window);
  • ecore_wl2_window_title_set(window, title); ?? @CHAN
  • ecore_wl2_window_type_set(window, Ecore_Wl2_Window_Type type);
  • ecore_wl2_window_update_begin(window); @CHAN
  • ecore_wl2_window_wm_rotation_supported_get(window);
  • ecore_wl2_window_wm_rotation_supported_set(window, enabled);


Differential Revisions
D10760: tests/ecore_wl2: Add test for ecore_wl2_window_free function
D10758: tests/ecore_wl2: Add test for ecore_wl2_window_buffer_tranform function
D10756: tests/ecore_wl2: Add test for ecore_wl2_window_buffer_attach function
D10754: tests/ecore_wl2: Add test for ecore_wl2_window_aux_hint functions
D10761 / rEFL7d40e03ca701: tests/ecore_wl2: Add test for ecore_wl2_window_title functions
D10759 / rEFL0bfdc94df82f: tests/ecore_wl2: Add test for ecore_wl2_window_class functions
rEFL00aaf99765a1: tests/ecore_wl2: Fix bad window test
D10747 / rEFL12cb64cfadb7: tests/ecore_wl2: Add test for ecore_wl2_window_aspect functions
D10755 / rEFL167cb43a9680: tests/ecore_wl2: Add test for ecore_wl2_window_available_rotations functions
D10746 / rEFLffc3c4a7e7d9: tests/ecore_wl2: Add test for ecore_wl2_window_activated_get function
rEFL8195368929be: tests/ecore_wl2: Add test for ecore_wl2_window_type functions
rEFLdd74c6ed35e2: tests/ecore_wl2: Add test for ecore_wl2_window_geometry functions
rEFL5b588c3c39a4: tests/ecore_wl2: Add test for ecore_wl2_window_wm_rotation_supported functions
rEFL96e148b2310e: tests/ecore_wl2: Modify ecore_wl2_window_rotation test
rEFL821352458395: tests/ecore_wl2: Add test for ecore_wl2_window_rotation_app functions
rEFLeb7816c72792: tests/ecore_wl2: Add test for ecore_wl2_window_preferred_rotation functions
rEFL67995823fd28: tests/ecore_wl2: Add test for ecore_wl2_window_maximized functions
rEFL239549deec2a: tests/ecore_wl2: Add test for ecore_wl2_window_fullscreen functions
rEFL52299bffa0e5: tests/ecore_wl2: Add test for ecore_wl2_window_focus_skip_get/set functions
rEFL17919040b6d9: tests/ecore_wl2: Add test for ecore_wl2_window_floating_mode_get/set functions
rEFL1357171d569a: tests/ecore_wl2: Add test for ecore_wl2_window_alpha_get/set functions
rEFLfb718059256e: tests/ecore_wl2: Add test for ecore_wl2_display_compositor_version_get
rEFL4068d1c5be2f: tests/ecore-wl2: Remove surface test
rEFL27a1ec507a27: tests/ecore_wl2: Skip aux_hints_supported test if not run in Enlightenment
rEFL10c0e37a72e4: tests/ecore_wl2: Add ecore_wl2_surface tests to build order
rEFLe533bef2bf56: tests/ecore_wl2: Add start of ecore_wl2_surface tests
rEFLadaea4170af0: tests/ecore_wl2: Add test for ecore_wl2_input_name_get
rEFL2c4b26ef4eb1: tests/ecore_wl2: Add test for ecore_wl2_input_keymap_get
rEFLf15ca5e227fc: tests/ecore_wl2: Add test for ecore_wl2_input_display_get function
rEFLf166cf3741c0: tests/ecore_wl2: Add test for ecore_wl2_input_seat_id_get function
rEFLf481b6acf19c: tests/ecore_wl2: Fix assert tests for some window functions
rEFL34514ccf58c8: tests/ecore_wl2: Add start of Ecore_Wl2_Input API tests
rEFLa526285db4dd: tests/ecore_wl2: Reduce calls to ecore_wl2_display_connect
rEFL725cce8cb406: tests/ecore_wl2: Combine tests of ecore_wl2_window_surface functions
rEFLc1c4072b0788: tests/ecore_wl2: Add wayland protocol as a dep for ecore_wl2 tests
rEFL28c232d770bf: tests/ecore_wl2: Add test for ecore_wl2_window_display_get
rEFLa7cc7730afce: tests/ecore_wl2: Add test for ecore_wl2_window_aux_hints_supported_get
rEFL5cf095dd3d8f: tests/ecore_wl2: Add test for ecore_wl2_window_output_find
rEFLafe8414925f5: tests/ecore_wl2: Add test for ecore_wl2_window_rotation_get
rEFL8510de33c37b: tests/ecore_wl2: Add test case for ecore_wl2_window_surface_id_get
rEFL11de06e5b801: tests/ecore_wl2: Add test for ecore_wl2_window_surface_get function
rEFLccfd74f17ab0: tests/ecore_wl2: Remove use of macros for display setup & connect
rEFLaf0a37da03a7: tests/ecore_wl2: Check for valid xdg_runtime_dir
rEFLf30ef634adbb: tests/ecore_wl2: Add start of Ecore_Wl2 Window tests
rEFL3be7c844fd81: tests/ecore_wl2: Add test for ecore_wl2_display_inputs_get
rEFL7a85ad660b9f: tests/ecore_wl2: Add test for ecore_wl2_display_registry_get function
rEFL539775b1cd1a: tests/ecore_wl2: Add test for ecore_wl2_display_globals_get function
rEFLa081920c7dda: tests/ecore_wl2: Add test for ecore_wl2_display_screen_size_get function
rEFL9ef1ab7876c2: tests/ecore_wl2: Add printf for compositor detection
rEFL7618a6caf01c: tests/ecore_wl2: Add ecore_wl2_display_dmabuf_get test
rEFL3a3a2f667a18: tests/ecore_wl2: Add ecore_wl2_display_shm_get test
rEFL723412404f81: tests/ecore_wl2: Add test cases for wl2 client-side functions
rEFLb9f89fabb6f9: tests: Add tests for ecore_wl2_display_get and ecore_wl2_display_name_get
rEFL73acf72cc433: tests: Add file for Ecore_Wl2 display tests
rEFL3b28a0a0f5bf: meson: Modify Ecore_Wl2 sub project to add tests
rEFLe33609937e90: tests: Add start of Ecore_Wl2 test suite
devilhorns triaged this task as Normal priority.
CHAN updated the task description. (Show Details)Mon, Nov 11, 9:13 PM
devilhorns updated the task description. (Show Details)Tue, Nov 12, 6:20 AM
devilhorns updated the task description. (Show Details)
devilhorns removed a subscriber: ManMower.
devilhorns updated the task description. (Show Details)Tue, Nov 12, 6:24 AM
devilhorns updated the task description. (Show Details)Tue, Nov 12, 6:59 AM
devilhorns updated the task description. (Show Details)Tue, Nov 12, 7:01 AM

@CHAN I added some more tests today and marked them off the list, However there is an issue with some of these functions (ones I marked with ?? at the end). Basically, I don't see how we can write tests for these functions because they only support a 'set'. As an example, ecore_wl2_window_class_set function ... We can make a test which executes that function, but we have no way to verify that the class actually gets set...

devilhorns updated the task description. (Show Details)Tue, Nov 12, 7:04 AM
devilhorns updated the task description. (Show Details)
devilhorns updated the task description. (Show Details)Tue, Nov 12, 7:09 AM
devilhorns updated the task description. (Show Details)Tue, Nov 19, 5:45 AM
devilhorns updated the task description. (Show Details)Tue, Nov 19, 6:44 AM
CHAN added a comment.EditedSun, Nov 24, 11:47 PM

@devilhorns Thanks for adding new TCs.
I will check the ?? marked APIs and i will add get API for it if it needs.

Anyway could you please share your test env?
Do you work on it weston? enlightenment?
I tried to add new Tc so, I run enlightenment_start and build efl with -Dwl=true options.
Then i run ninja test but the getenv("WAYLAND_DISPLAY") is always fail.
We should better work on same env.

@CHAN I currently run the tests while using Weston compositor in a second tty.

devilhorns updated the task description. (Show Details)Mon, Nov 25, 11:56 AM
CHAN added a comment.Mon, Nov 25, 8:51 PM

@devilhorns I tried to run tests on Weston compositor (Just command weston in ubuntu.)
I built efl -Dwl=true -Dx11=false. and enabled ecore-wl2 tests in
then export ELM_DISPLAY="wl" , export WAYLAND_DISPLAY="wayland-0"

The elementary_test works well tho.
I can't get any result of the ecore-wl2 tests.
env setting may failure on my environment.

I set both of them (WAYLAND_DISPLAY, XDG_RUNTIME_DIR) in the test code but its not work.

Could you please tell me detail of the env for running ecore-wl2 test?
I will first create an environment and add test cases to it, so that I can share it with others.

I actually do not export anything. I just run Weston. Open a terminal inside Weston. Then I build efl as normal (with wayland options enabled). After the build is done, I change directory to "efl/build" in that terminal then just run "meson test ecore_wl2-suite". Note that there are 2 tests that fail currently. One is an input test, and the other is an output test

CHAN updated the task description. (Show Details)Tue, Nov 26, 11:37 PM
CHAN updated the task description. (Show Details)
CHAN added a subscriber: eagle001.Tue, Nov 26, 11:51 PM

@devilhorns Thanks you for sharing information.

@eagle001 @myoungwoon Now i assigned each APIs test case creation owner for you guys.

I've split it on a file base.

Let's make a TC that is as meaningful as possible and request review it to @devilhorns.
If you have difficulty creating TC, let's create one and get helps from others.

CHAN added a comment.EditedWed, Nov 27, 12:17 AM

Add ecore_wl2_window_title_get, ecore_wl2_window_role_get, ecore_wl2_window_class_get, ecore_wl2_window_aspect_get APIs


devilhorns updated the task description. (Show Details)Tue, Dec 3, 8:33 AM