mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-07-22 11:14:21 +00:00
tests: migrate ivi-layout-internal
Moving to the new harness. It would be possible to convert every case here into a separate PLUGIN_TEST, but I did not see the value in that at this time. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
7f840b721a
commit
ad1a4102fe
|
@ -38,6 +38,20 @@
|
||||||
#include "ivi-shell/ivi-layout-private.h"
|
#include "ivi-shell/ivi-layout-private.h"
|
||||||
#include "ivi-test.h"
|
#include "ivi-test.h"
|
||||||
#include "shared/helpers.h"
|
#include "shared/helpers.h"
|
||||||
|
#include "weston-test-runner.h"
|
||||||
|
#include "weston-test-fixture-compositor.h"
|
||||||
|
|
||||||
|
static enum test_result_code
|
||||||
|
fixture_setup(struct weston_test_harness *harness)
|
||||||
|
{
|
||||||
|
struct compositor_setup setup;
|
||||||
|
|
||||||
|
compositor_setup_defaults(&setup);
|
||||||
|
setup.shell = SHELL_IVI;
|
||||||
|
|
||||||
|
return weston_test_harness_execute_as_plugin(harness, &setup);
|
||||||
|
}
|
||||||
|
DECLARE_FIXTURE_SETUP(fixture_setup);
|
||||||
|
|
||||||
struct test_context {
|
struct test_context {
|
||||||
struct weston_compositor *compositor;
|
struct weston_compositor *compositor;
|
||||||
|
@ -942,10 +956,8 @@ test_surface_bad_remove_notification(struct test_context *ctx)
|
||||||
/************************ tests end ********************************/
|
/************************ tests end ********************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
run_internal_tests(void *data)
|
run_internal_tests(struct test_context *ctx)
|
||||||
{
|
{
|
||||||
struct test_context *ctx = data;
|
|
||||||
|
|
||||||
test_surface_bad_visibility(ctx);
|
test_surface_bad_visibility(ctx);
|
||||||
test_surface_bad_destination_rectangle(ctx);
|
test_surface_bad_destination_rectangle(ctx);
|
||||||
test_surface_bad_source_rectangle(ctx);
|
test_surface_bad_source_rectangle(ctx);
|
||||||
|
@ -987,35 +999,24 @@ run_internal_tests(void *data)
|
||||||
test_surface_bad_create_notification(ctx);
|
test_surface_bad_create_notification(ctx);
|
||||||
test_layer_bad_remove_notification(ctx);
|
test_layer_bad_remove_notification(ctx);
|
||||||
test_surface_bad_remove_notification(ctx);
|
test_surface_bad_remove_notification(ctx);
|
||||||
|
|
||||||
weston_compositor_exit_with_code(ctx->compositor, EXIT_SUCCESS);
|
|
||||||
free(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT int
|
PLUGIN_TEST(ivi_layout_internal)
|
||||||
wet_module_init(struct weston_compositor *compositor,
|
|
||||||
int *argc, char *argv[])
|
|
||||||
{
|
{
|
||||||
struct wl_event_loop *loop;
|
/* struct weston_compositor *compositor; */
|
||||||
struct test_context *ctx;
|
struct test_context ctx = {};
|
||||||
const struct ivi_layout_interface *iface;
|
const struct ivi_layout_interface *iface;
|
||||||
|
|
||||||
iface = ivi_layout_get_api(compositor);
|
iface = ivi_layout_get_api(compositor);
|
||||||
|
|
||||||
if (!iface) {
|
if (!iface) {
|
||||||
weston_log("fatal: cannot use ivi_layout_interface.\n");
|
weston_log("fatal: cannot use ivi_layout_interface.\n");
|
||||||
return -1;
|
weston_compositor_exit_with_code(compositor, RESULT_HARD_ERROR);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = zalloc(sizeof(*ctx));
|
ctx.compositor = compositor;
|
||||||
if (!ctx)
|
ctx.layout_interface = iface;
|
||||||
return -1;
|
|
||||||
|
|
||||||
ctx->compositor = compositor;
|
run_internal_tests(&ctx);
|
||||||
ctx->layout_interface = iface;
|
|
||||||
|
|
||||||
loop = wl_display_get_event_loop(compositor->wl_display);
|
|
||||||
wl_event_loop_add_idle(loop, run_internal_tests, ctx);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,9 +218,6 @@ if get_option('shell-ivi')
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
tests_weston_plugin += [
|
|
||||||
['ivi-layout-internal'],
|
|
||||||
]
|
|
||||||
|
|
||||||
ivi_layout_test_plugin = shared_library(
|
ivi_layout_test_plugin = shared_library(
|
||||||
'test-ivi-layout',
|
'test-ivi-layout',
|
||||||
|
@ -246,6 +243,7 @@ if get_option('shell-ivi')
|
||||||
],
|
],
|
||||||
'test_deps': [ ivi_layout_test_plugin ],
|
'test_deps': [ ivi_layout_test_plugin ],
|
||||||
},
|
},
|
||||||
|
{ 'name': 'ivi-layout-internal', },
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue