tests: Convert ivi-shell-app-test.c to use `weston_ini_setup`

Convert ivi-shell-app-test.c to use `weston_ini_setup`. It also removes
the pre-made weston.ini and all the related code in the meson files.

Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
dev
Igor Matheus Andrade Torrente 4 years ago
parent 495a892190
commit d8e09afc9f
  1. 5
      ivi-shell/meson.build
  2. 98
      ivi-shell/weston.ini.in
  3. 96
      tests/ivi-shell-app-test.c
  4. 1
      tests/meson.build

@ -53,9 +53,4 @@ if get_option('shell-ivi')
ivi_test_config.set('libexecdir', dir_libexec) ivi_test_config.set('libexecdir', dir_libexec)
ivi_test_config.set('plugin_prefix', meson.current_build_dir()) ivi_test_config.set('plugin_prefix', meson.current_build_dir())
ivi_test_config.set('westondatadir', join_paths(dir_data, 'weston')) ivi_test_config.set('westondatadir', join_paths(dir_data, 'weston'))
ivi_test_ini = configure_file(
input: '../ivi-shell/weston.ini.in',
output: 'weston-ivi-test.ini',
configuration: ivi_test_config
)
endif endif

@ -1,98 +0,0 @@
[core]
shell=ivi-shell.so
modules=hmi-controller.so
[ivi-shell]
ivi-shell-user-interface=weston-ivi-shell-user-interface
#developermode=true
cursor-theme=default
cursor-size=32
base-layer-id=1000
base-layer-id-offset=10000
workspace-background-layer-id=2000
workspace-layer-id=3000
application-layer-id=4000
transition-duration=300
background-image=@westondatadir@/background.png
background-id=1001
panel-image=@westondatadir@/panel.png
panel-id=1002
surface-id-offset=10
tiling-image=@westondatadir@/tiling.png
tiling-id=1003
sidebyside-image=@westondatadir@/sidebyside.png
sidebyside-id=1004
fullscreen-image=@westondatadir@/fullscreen.png
fullscreen-id=1005
random-image=@westondatadir@/random.png
random-id=1006
home-image=@westondatadir@/home.png
home-id=1007
workspace-background-color=0x99000000
workspace-background-id=2001
[ivi-launcher]
workspace-id=0
icon-id=4001
icon=@westondatadir@/icon_ivi_flower.png
path=@bindir@/weston-flower
[ivi-launcher]
workspace-id=0
icon-id=4002
icon=@westondatadir@/icon_ivi_clickdot.png
path=@bindir@/weston-clickdot
[ivi-launcher]
workspace-id=1
icon-id=4003
icon=@westondatadir@/icon_ivi_simple-egl.png
path=@bindir@/weston-simple-egl
[ivi-launcher]
workspace-id=1
icon-id=4004
icon=@westondatadir@/icon_ivi_simple-shm.png
path=@bindir@/weston-simple-shm
[ivi-launcher]
workspace-id=2
icon-id=4005
icon=@westondatadir@/icon_ivi_smoke.png
path=@bindir@/weston-smoke
[ivi-launcher]
workspace-id=3
icon-id=4006
icon=@westondatadir@/icon_ivi_flower.png
path=@bindir@/weston-flower
[ivi-launcher]
workspace-id=3
icon-id=4007
icon=@westondatadir@/icon_ivi_clickdot.png
path=@bindir@/weston-clickdot
[ivi-launcher]
workspace-id=3
icon-id=4008
icon=@westondatadir@/icon_ivi_simple-egl.png
path=@bindir@/weston-simple-egl
[ivi-launcher]
workspace-id=3
icon-id=4009
icon=@westondatadir@/icon_ivi_simple-shm.png
path=@bindir@/weston-simple-shm
[ivi-launcher]
workspace-id=3
icon-id=4010
icon=@westondatadir@/icon_ivi_smoke.png
path=@bindir@/weston-smoke

@ -40,10 +40,102 @@ fixture_setup(struct weston_test_harness *harness)
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.shell = SHELL_IVI; setup.shell = SHELL_IVI;
/** TODO: Convert this test to use weston_ini_setup */
setup.config_file = strdup(TESTSUITE_IVI_CONFIG_PATH);
setup.logging_scopes = "log,test-harness-plugin,proto"; setup.logging_scopes = "log,test-harness-plugin,proto";
weston_ini_setup(&setup,
cfgln("[core]"),
cfgln("shell=%s", "ivi-shell.so"),
cfgln("modules=", "hmi-controller.so"),
cfgln("[ivi-shell]"),
cfgln("ivi-shell-user-interface=%s", "weston-ivi-shell-user-interface"),
cfgln("cursor-theme=%s", "default"),
cfgln("cursor-size=%d", 32),
cfgln("base-layer-id=%d", 1000),
cfgln("base-layer-id-offset=%d", 10000),
cfgln("workspace-background-layer-id=%d", 2000),
cfgln("workspace-layer-id=%d", 3000),
cfgln("application-layer-id=%d", 4000),
cfgln("transition-duration=%d", 300),
cfgln("background-image=%s", WESTON_DATA_DIR "/background.png"),
cfgln("background-id=%d", 1001),
cfgln("panel-image=%s", WESTON_DATA_DIR "/panel.png"),
cfgln("panel-id=%d", 1002),
cfgln("surface-id-offset=%d", 10),
cfgln("tiling-image=%s", WESTON_DATA_DIR "/tiling.png"),
cfgln("tiling-id=%d", 1003),
cfgln("sidebyside-image=%s", WESTON_DATA_DIR "/sidebyside.png"),
cfgln("sidebyside-id=%d", 1004),
cfgln("fullscreen-image=%s", WESTON_DATA_DIR "/fullscreen.png"),
cfgln("fullscreen-id=%d", 1005),
cfgln("random-image=%s", WESTON_DATA_DIR "/random.png"),
cfgln("random-id=%d", 1006),
cfgln("home-image=%s", WESTON_DATA_DIR "/home.png"),
cfgln("home-id=%d", 1007),
cfgln("workspace-background-color=%s", "0x99000000"),
cfgln("workspace-background-id=%d", 2001),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 0),
cfgln("icon-id=%d", 4001),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_flower.png"),
cfgln("path=%s", BINDIR "/weston-flower"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 0),
cfgln("icon-id=%d", 4002),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_clickdot.png"),
cfgln("path=%s", BINDIR "/weston-clickdot"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 1),
cfgln("icon-id=%d", 4003),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_simple-egl.png"),
cfgln("path=%s", BINDIR "/weston-simple-egl"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 1),
cfgln("icon-id=%d", 4004),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_simple-shm.png"),
cfgln("path=%s", BINDIR "/weston-simple-shm"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 2),
cfgln("icon-id=%d", 4005),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_smoke.png"),
cfgln("path=%s", BINDIR "/weston-smoke"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 3),
cfgln("icon-id=%d", 4006),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_flower.png"),
cfgln("path=%s", BINDIR "/weston-flower"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 3),
cfgln("icon-id=%d", 4007),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_clickdot.png"),
cfgln("path=%s", BINDIR "/weston-clickdot"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 3),
cfgln("icon-id=%d", 4008),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_simple-egl.png"),
cfgln("path=%s", BINDIR "/weston-simple-egl"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 3),
cfgln("icon-id=%d", 4009),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_simple-shm.png"),
cfgln("path=%s", BINDIR "/weston-simple-shm"),
cfgln("[ivi-launcher]"),
cfgln("workspace-id=%d", 3),
cfgln("icon-id=%d", 4010),
cfgln("icon=%s", WESTON_DATA_DIR "/icon_ivi_smoke.png"),
cfgln("path=%s", BINDIR "/weston-smoke")
);
return weston_test_harness_execute_as_client(harness, &setup); return weston_test_harness_execute_as_client(harness, &setup);
} }
DECLARE_FIXTURE_SETUP(fixture_setup); DECLARE_FIXTURE_SETUP(fixture_setup);

@ -266,7 +266,6 @@ test_config_h.set_quoted('WESTON_TEST_REFERENCE_PATH', meson.current_source_dir(
test_config_h.set_quoted('WESTON_MODULE_MAP', env_modmap) test_config_h.set_quoted('WESTON_MODULE_MAP', env_modmap)
test_config_h.set_quoted('WESTON_DATA_DIR', join_paths(meson.current_source_dir(), '..', 'data')) test_config_h.set_quoted('WESTON_DATA_DIR', join_paths(meson.current_source_dir(), '..', 'data'))
test_config_h.set_quoted('TESTSUITE_PLUGIN_PATH', exe_plugin_test.full_path()) test_config_h.set_quoted('TESTSUITE_PLUGIN_PATH', exe_plugin_test.full_path())
test_config_h.set_quoted('TESTSUITE_IVI_CONFIG_PATH', join_paths(meson.current_build_dir(), '../ivi-shell/weston-ivi-test.ini'))
configure_file(output: 'test-config.h', configuration: test_config_h) configure_file(output: 'test-config.h', configuration: test_config_h)
foreach t : tests foreach t : tests

Loading…
Cancel
Save