[PATCH RFC weston 2/4] tests: Reshuffle IVI layout tests

Daniel Stone daniels at collabora.com
Tue Nov 29 17:00:01 UTC 2016


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.

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 Makefile.am                                              | 16 ++++++++--------
 ivi-shell/hmi-controller.c                               | 12 +++++++++++-
 ivi-shell/weston.ini.in                                  |  8 ++++----
 ...layout-internal-test.c => ivi-layout-internal-test.c} |  0
 tests/{ivi_layout-test.c => ivi-layout-test-client.c}    |  0
 tests/{ivi_layout-test-plugin.c => ivi-layout-test.c}    |  2 +-
 tests/weston-tests-env                                   |  2 +-
 7 files changed, 25 insertions(+), 15 deletions(-)
 rename tests/{ivi_layout-internal-test.c => ivi-layout-internal-test.c} (100%)
 rename tests/{ivi_layout-test.c => ivi-layout-test-client.c} (100%)
 rename tests/{ivi_layout-test-plugin.c => ivi-layout-test.c} (99%)

diff --git a/Makefile.am b/Makefile.am
index ac38301..4f8c837 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1374,13 +1374,13 @@ ivi_layout_internal_test_la_LIBADD = $(COMPOSITOR_LIBS)
 ivi_layout_internal_test_la_LDFLAGS = $(test_module_ldflags)
 ivi_layout_internal_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
 ivi_layout_internal_test_la_SOURCES =			\
-	tests/ivi_layout-internal-test.c
+	tests/ivi-layout-internal-test.c
 
 ivi_layout_test_la_LIBADD = $(COMPOSITOR_LIBS)
 ivi_layout_test_la_LDFLAGS = $(test_module_ldflags)
 ivi_layout_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
 ivi_layout_test_la_SOURCES =			\
-	tests/ivi_layout-test-plugin.c		\
+	tests/ivi-layout-test.c		\
 	tests/ivi-test.h			\
 	shared/helpers.h
 nodist_ivi_layout_test_la_SOURCES =		\
@@ -1397,17 +1397,17 @@ nodist_ivi_shell_app_weston_SOURCES =		\
 ivi_shell_app_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
 ivi_shell_app_weston_LDADD = libtest-client.la
 
-noinst_PROGRAMS += ivi-layout.ivi
+noinst_PROGRAMS += ivi-layout-test-client.ivi
 
-ivi_layout_ivi_SOURCES =			\
-	tests/ivi_layout-test.c 		\
+ivi_layout_test_client_ivi_SOURCES =			\
+	tests/ivi-layout-test-client.c 		\
 	tests/ivi-test.h			\
 	shared/helpers.h
-nodist_ivi_layout_ivi_SOURCES = 		\
+nodist_ivi_layout_test_client_ivi_SOURCES = 		\
 	protocol/ivi-application-protocol.c	\
 	protocol/ivi-application-client-protocol.h
-ivi_layout_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
-ivi_layout_ivi_LDADD = libtest-client.la
+ivi_layout_test_client_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
+ivi_layout_test_client_ivi_LDADD = libtest-client.la
 endif
 
 if BUILD_SETBACKLIGHT
diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index f3a8830..7805b3b 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -681,6 +681,7 @@ hmi_server_setting_create(struct weston_compositor *ec)
 	struct hmi_server_setting *setting = MEM_ALLOC(sizeof(*setting));
 	struct weston_config *config = wet_get_config(ec);
 	struct weston_config_section *shell_section = NULL;
+	char *ivi_ui_config;
 
 	shell_section = weston_config_get_section(config, "ivi-shell",
 						  NULL, NULL);
@@ -709,7 +710,16 @@ hmi_server_setting_create(struct weston_compositor *ec)
 
 	weston_config_section_get_string(shell_section,
 					 "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;
 }
diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in
index 9b53691..fcd0431 100644
--- a/ivi-shell/weston.ini.in
+++ b/ivi-shell/weston.ini.in
@@ -1,9 +1,9 @@
 [core]
-shell=@plugin_prefix at ivi-shell.so
+shell=ivi-shell.so
 
 [ivi-shell]
-ivi-module=@plugin_prefix at hmi-controller.so
-ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface
+ivi-module=hmi-controller.so
+ivi-shell-user-interface=weston-ivi-shell-user-interface
 
 #developermode=true
 
@@ -38,7 +38,7 @@ workspace-background-color=0x99000000
 workspace-background-id=2001
 
 [input-method]
-path=@libexecdir@/weston-keyboard
+path=weston-keyboard
 
 [ivi-launcher]
 workspace-id=0
diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi-layout-internal-test.c
similarity index 100%
rename from tests/ivi_layout-internal-test.c
rename to tests/ivi-layout-internal-test.c
diff --git a/tests/ivi_layout-test.c b/tests/ivi-layout-test-client.c
similarity index 100%
rename from tests/ivi_layout-test.c
rename to tests/ivi-layout-test-client.c
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi-layout-test.c
similarity index 99%
rename from tests/ivi_layout-test-plugin.c
rename to tests/ivi-layout-test.c
index 48be7f4..d5bf60e 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi-layout-test.c
@@ -240,7 +240,7 @@ controller_module_init(struct weston_compositor *compositor,
 		return -1;
 	}
 
-	if (weston_module_path_from_env("weston-ivi-layout-test", path,
+	if (weston_module_path_from_env("weston-ivi-layout-test-client", path,
 					sizeof path) == 0) {
 		weston_log("test setup failure: WESTON_MODULE_MAP not set\n");
 		return -1;
diff --git a/tests/weston-tests-env b/tests/weston-tests-env
index 019e49f..e962731 100755
--- a/tests/weston-tests-env
+++ b/tests/weston-tests-env
@@ -38,7 +38,7 @@ for exe in weston-desktop-shell weston-keyboard weston-screenshooter \
 	WESTON_MODULE_MAP="${WESTON_MODULE_MAP}${exe}=${abs_builddir}/${exe};"
 done
 
-WESTON_MODULE_MAP="${WESTON_MODULE_MAP}weston-ivi-layout-test=${abs_builddir}/ivi-layout.ivi;"
+WESTON_MODULE_MAP="${WESTON_MODULE_MAP}weston-ivi-layout-test-client=${abs_builddir}/ivi-layout-test-client.ivi;"
 
 export WESTON_MODULE_MAP
 
-- 
2.9.3



More information about the wayland-devel mailing list