tests: Reshuffle IVI layout tests

Rename the IVI tests to be more consistent with the others, and invert
the naming of plugin/client to make it slightly more clear what's going
to happen. Handle the renaming by using wet_get_binary_path to rewrite
the local binaries.

As a side-effect, weston.ini ivi-shell-user-interface no longer needs to
be given as an absolute path.

Signed-off-by: Daniel Stone <daniels@collabora.com>

v2:

Call ivi-layout.ivi as ivi-layout-test-client.ivi to keep the same name
in both the file and the lookup, so that the module map does not need to
change the name.

Update code comments to reflect the new names.

Rename ivi_layout-test-plugin.c to ivi-layout-test-plugin.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
dev
Daniel Stone 8 years ago committed by Pekka Paalanen
parent f5c96467e3
commit 78a42116ae
  1. 16
      Makefile.am
  2. 12
      ivi-shell/hmi-controller.c
  3. 8
      ivi-shell/weston.ini.in
  4. 0
      tests/ivi-layout-internal-test.c
  5. 8
      tests/ivi-layout-test-client.c
  6. 12
      tests/ivi-layout-test-plugin.c
  7. 2
      tests/weston-tests-env

@ -1477,13 +1477,13 @@ ivi_layout_internal_test_la_LIBADD = $(test_module_libadd)
ivi_layout_internal_test_la_LDFLAGS = $(test_module_ldflags) ivi_layout_internal_test_la_LDFLAGS = $(test_module_ldflags)
ivi_layout_internal_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_layout_internal_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
ivi_layout_internal_test_la_SOURCES = \ ivi_layout_internal_test_la_SOURCES = \
tests/ivi_layout-internal-test.c tests/ivi-layout-internal-test.c
ivi_layout_test_la_LIBADD = $(test_module_libadd) ivi_layout_test_la_LIBADD = $(test_module_libadd)
ivi_layout_test_la_LDFLAGS = $(test_module_ldflags) ivi_layout_test_la_LDFLAGS = $(test_module_ldflags)
ivi_layout_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_layout_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
ivi_layout_test_la_SOURCES = \ ivi_layout_test_la_SOURCES = \
tests/ivi_layout-test-plugin.c \ tests/ivi-layout-test-plugin.c \
tests/ivi-test.h \ tests/ivi-test.h \
shared/helpers.h shared/helpers.h
nodist_ivi_layout_test_la_SOURCES = \ nodist_ivi_layout_test_la_SOURCES = \
@ -1500,17 +1500,17 @@ nodist_ivi_shell_app_weston_SOURCES = \
ivi_shell_app_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) ivi_shell_app_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
ivi_shell_app_weston_LDADD = libtest-client.la ivi_shell_app_weston_LDADD = libtest-client.la
noinst_PROGRAMS += ivi-layout.ivi noinst_PROGRAMS += ivi-layout-test-client.ivi
ivi_layout_ivi_SOURCES = \ ivi_layout_test_client_ivi_SOURCES = \
tests/ivi_layout-test.c \ tests/ivi-layout-test-client.c \
tests/ivi-test.h \ tests/ivi-test.h \
shared/helpers.h shared/helpers.h
nodist_ivi_layout_ivi_SOURCES = \ nodist_ivi_layout_test_client_ivi_SOURCES = \
protocol/ivi-application-protocol.c \ protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h protocol/ivi-application-client-protocol.h
ivi_layout_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) ivi_layout_test_client_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
ivi_layout_ivi_LDADD = libtest-client.la ivi_layout_test_client_ivi_LDADD = libtest-client.la
endif endif
if BUILD_SETBACKLIGHT if BUILD_SETBACKLIGHT

@ -676,6 +676,7 @@ hmi_server_setting_create(struct weston_compositor *ec)
struct hmi_server_setting *setting = MEM_ALLOC(sizeof(*setting)); struct hmi_server_setting *setting = MEM_ALLOC(sizeof(*setting));
struct weston_config *config = wet_get_config(ec); struct weston_config *config = wet_get_config(ec);
struct weston_config_section *shell_section = NULL; struct weston_config_section *shell_section = NULL;
char *ivi_ui_config;
shell_section = weston_config_get_section(config, "ivi-shell", shell_section = weston_config_get_section(config, "ivi-shell",
NULL, NULL); NULL, NULL);
@ -704,7 +705,16 @@ hmi_server_setting_create(struct weston_compositor *ec)
weston_config_section_get_string(shell_section, weston_config_section_get_string(shell_section,
"ivi-shell-user-interface", "ivi-shell-user-interface",
&setting->ivi_homescreen, NULL); &ivi_ui_config, NULL);
if (ivi_ui_config && ivi_ui_config[0] != '/') {
setting->ivi_homescreen = wet_get_binary_path(ivi_ui_config);
if (setting->ivi_homescreen)
free(ivi_ui_config);
else
setting->ivi_homescreen = ivi_ui_config;
} else {
setting->ivi_homescreen = ivi_ui_config;
}
return setting; return setting;
} }

@ -1,9 +1,9 @@
[core] [core]
shell=@plugin_prefix@ivi-shell.so shell=ivi-shell.so
modules=@plugin_prefix@hmi-controller.so modules=hmi-controller.so
[ivi-shell] [ivi-shell]
ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface ivi-shell-user-interface=weston-ivi-shell-user-interface
#developermode=true #developermode=true
@ -38,7 +38,7 @@ workspace-background-color=0x99000000
workspace-background-id=2001 workspace-background-id=2001
[input-method] [input-method]
path=@libexecdir@/weston-keyboard path=weston-keyboard
[ivi-launcher] [ivi-launcher]
workspace-id=0 workspace-id=0

@ -175,18 +175,18 @@ ivi_window_destroy(struct ivi_window *wnd)
/******************************** tests ********************************/ /******************************** tests ********************************/
/* /*
* This is a test program, launched by ivi_layout-test-plugin.c. Each TEST() * This is a test program, launched by ivi-layout-test-plugin.c. Each TEST()
* is forked and exec'd as usual with the weston-test-runner framework. * is forked and exec'd as usual with the weston-test-runner framework.
* *
* These tests make use of weston_test_runner global interface exposed by * These tests make use of weston_test_runner global interface exposed by
* ivi_layout-test-plugin.c. This allows these tests to trigger compositor-side * ivi-layout-test-plugin.c. This allows these tests to trigger compositor-side
* checks. * checks.
* *
* See ivi_layout-test-plugin.c for further details. * See ivi-layout-test-plugin.c for further details.
*/ */
/** /**
* RUNNER_TEST() names are defined in ivi_layout-test-plugin.c. * RUNNER_TEST() names are defined in ivi-layout-test-plugin.c.
* Each RUNNER_TEST name listed here uses the same simple initial client setup. * Each RUNNER_TEST name listed here uses the same simple initial client setup.
*/ */
const char * const basic_test_names[] = { const char * const basic_test_names[] = {

@ -237,7 +237,8 @@ wet_module_init(struct weston_compositor *compositor,
if (!launcher) if (!launcher)
return -1; return -1;
if (weston_module_path_from_env("ivi-layout.ivi", launcher->exe, if (weston_module_path_from_env("ivi-layout-test-client.ivi",
launcher->exe,
sizeof launcher->exe) == 0) { sizeof launcher->exe) == 0) {
weston_log("test setup failure: WESTON_MODULE_MAP not set\n"); weston_log("test setup failure: WESTON_MODULE_MAP not set\n");
return -1; return -1;
@ -300,11 +301,12 @@ runner_assert_fail(const char *cond, const char *file, int line,
* this module specially by loading it in ivi-shell. * this module specially by loading it in ivi-shell.
* *
* Once Weston init completes, this module launches one test program: * Once Weston init completes, this module launches one test program:
* ivi-layout.ivi (ivi_layout-test.c). That program uses the weston-test-runner * ivi-layout-test-client.ivi (ivi-layout-test-client.c).
* framework to fork and exec each TEST() in ivi_layout-test.c with a fresh * That program uses the weston-test-runner
* framework to fork and exec each TEST() in ivi-layout-test-client.c with a fresh
* connection to the single compositor instance. * connection to the single compositor instance.
* *
* Each TEST() in ivi_layout-test.c will bind to weston_test_runner global * Each TEST() in ivi-layout-test-client.c will bind to weston_test_runner global
* interface. A TEST() will set up the client state, and issue * interface. A TEST() will set up the client state, and issue
* weston_test_runner.run request to execute the compositor-side of the test. * weston_test_runner.run request to execute the compositor-side of the test.
* *
@ -317,7 +319,7 @@ runner_assert_fail(const char *cond, const char *file, int line,
* runner_assert_or_return(). This module catches the test program exit * runner_assert_or_return(). This module catches the test program exit
* code and passes it out of Weston to the test harness. * code and passes it out of Weston to the test harness.
* *
* A single TEST() in ivi_layout-test.c may use multiple RUNNER_TEST()s to * A single TEST() in ivi-layout-test-client.c may use multiple RUNNER_TEST()s to
* achieve multiple test points over a client action sequence. * achieve multiple test points over a client action sequence.
*/ */

@ -34,7 +34,7 @@ for mod in cms-colord cms-static desktop-shell drm-backend fbdev-backend \
done done
for exe in weston-desktop-shell weston-keyboard weston-screenshooter \ for exe in weston-desktop-shell weston-keyboard weston-screenshooter \
weston-simple-im ivi-layout.ivi; do \ weston-simple-im ivi-layout-test-client.ivi; do \
WESTON_MODULE_MAP="${WESTON_MODULE_MAP}${exe}=${abs_builddir}/${exe};" WESTON_MODULE_MAP="${WESTON_MODULE_MAP}${exe}=${abs_builddir}/${exe};"
done done

Loading…
Cancel
Save