From 9615ad8b91b26bcf2b31233059c55cb82d5d1757 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 11 Nov 2019 17:29:41 +0200 Subject: [PATCH] tests: migrate internal-screenshot Signed-off-by: Pekka Paalanen --- tests/internal-screenshot-test.c | 18 +++++++++++++++++- tests/meson.build | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/internal-screenshot-test.c b/tests/internal-screenshot-test.c index fb5ed5f8..e1a7c43b 100644 --- a/tests/internal-screenshot-test.c +++ b/tests/internal-screenshot-test.c @@ -29,8 +29,24 @@ #include #include "weston-test-client-helper.h" +#include "weston-test-fixture-compositor.h" +#include "test-config.h" -char *server_parameters="--use-pixman --width=320 --height=240"; +static enum test_result_code +fixture_setup(struct weston_test_harness *harness) +{ + struct compositor_setup setup; + + compositor_setup_defaults(&setup); + setup.renderer = RENDERER_PIXMAN; + setup.width = 320; + setup.height = 240; + setup.shell = SHELL_DESKTOP; + setup.config_file = TESTSUITE_INTERNAL_SCREENSHOT_CONFIG_PATH; + + return weston_test_harness_execute_as_client(harness, &setup); +} +DECLARE_FIXTURE_SETUP(fixture_setup); static void draw_stuff(pixman_image_t *image) diff --git a/tests/meson.build b/tests/meson.build index 14582478..2daf9cff 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -111,6 +111,7 @@ dep_zucmain = declare_dependency( ) tests = [ + { 'name': 'internal-screenshot', }, { 'name': 'plugin-registry', }, { 'name': 'roles', }, { 'name': 'string', }, @@ -153,7 +154,6 @@ tests_weston = [ linux_explicit_synchronization_unstable_v1_protocol_c, ] ], - ['internal-screenshot'], [ 'presentation', [ @@ -257,6 +257,7 @@ 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('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')) +test_config_h.set_quoted('TESTSUITE_INTERNAL_SCREENSHOT_CONFIG_PATH', join_paths(meson.current_source_dir(), 'internal-screenshot.ini')) configure_file(output: 'test-config.h', configuration: test_config_h) foreach t : tests