Commit 701676d8 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Daniel Stone
Browse files

tests: migrate client tests



This migrates all the client tests that have nothing special in them to the new
test harness.
Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
parent 3fb67936
...@@ -34,6 +34,18 @@ ...@@ -34,6 +34,18 @@
#include "shared/os-compatibility.h" #include "shared/os-compatibility.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
/* These three functions are copied from shared/os-compatibility.c in order to /* These three functions are copied from shared/os-compatibility.c in order to
* behave like older clients, and allow ftruncate() to shrink the file’s size, * behave like older clients, and allow ftruncate() to shrink the file’s size,
......
...@@ -27,6 +27,18 @@ ...@@ -27,6 +27,18 @@
#include "config.h" #include "config.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
static int static int
output_contains_client(struct client *client) output_contains_client(struct client *client)
......
...@@ -30,6 +30,18 @@ ...@@ -30,6 +30,18 @@
#include "input-timestamps-helper.h" #include "input-timestamps-helper.h"
#include "shared/timespec-util.h" #include "shared/timespec-util.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
static const struct timespec t1 = { .tv_sec = 1, .tv_nsec = 1000001 }; static const struct timespec t1 = { .tv_sec = 1, .tv_nsec = 1000001 };
static const struct timespec t2 = { .tv_sec = 2, .tv_nsec = 2000001 }; static const struct timespec t2 = { .tv_sec = 2, .tv_nsec = 2000001 };
......
...@@ -111,18 +111,72 @@ dep_zucmain = declare_dependency( ...@@ -111,18 +111,72 @@ dep_zucmain = declare_dependency(
) )
tests = [ tests = [
{ 'name': 'bad-buffer', },
{ 'name': 'devices', }, { 'name': 'devices', },
{ 'name': 'event', },
{ 'name': 'internal-screenshot', }, { 'name': 'internal-screenshot', },
{
'name': 'keyboard',
'sources': [
'keyboard-test.c',
'input-timestamps-helper.c',
input_timestamps_unstable_v1_client_protocol_h,
input_timestamps_unstable_v1_protocol_c,
],
},
{ 'name': 'plugin-registry', }, { 'name': 'plugin-registry', },
{
'name': 'pointer',
'sources': [
'pointer-test.c',
'input-timestamps-helper.c',
input_timestamps_unstable_v1_client_protocol_h,
input_timestamps_unstable_v1_protocol_c,
],
},
{
'name': 'presentation',
'sources': [
'presentation-test.c',
presentation_time_client_protocol_h,
presentation_time_protocol_c,
],
},
{ 'name': 'roles', }, { 'name': 'roles', },
{ 'name': 'string', }, { 'name': 'string', },
{ 'name': 'subsurface', },
{ 'name': 'subsurface-shot', }, { 'name': 'subsurface-shot', },
{ 'name': 'surface', }, { 'name': 'surface', },
{ 'name': 'surface-global', }, { 'name': 'surface-global', },
{
'name': 'text',
'sources': [
'text-test.c',
text_input_unstable_v1_client_protocol_h,
text_input_unstable_v1_protocol_c,
],
},
{
'name': 'touch',
'sources': [
'touch-test.c',
'input-timestamps-helper.c',
input_timestamps_unstable_v1_client_protocol_h,
input_timestamps_unstable_v1_protocol_c,
],
},
{ {
'name': 'vertex-clip', 'name': 'vertex-clip',
'dep_objs': dep_vertex_clipping, 'dep_objs': dep_vertex_clipping,
}, },
{
'name': 'viewporter',
'sources': [
'viewporter-test.c',
viewporter_client_protocol_h,
viewporter_protocol_c,
],
},
] ]
tests_standalone = [ tests_standalone = [
...@@ -139,16 +193,6 @@ tests_standalone = [ ...@@ -139,16 +193,6 @@ tests_standalone = [
] ]
tests_weston = [ tests_weston = [
['bad-buffer'],
['event'],
[
'keyboard',
[
'input-timestamps-helper.c',
input_timestamps_unstable_v1_client_protocol_h,
input_timestamps_unstable_v1_protocol_c,
]
],
[ [
'linux-explicit-synchronization', 'linux-explicit-synchronization',
[ [
...@@ -156,44 +200,6 @@ tests_weston = [ ...@@ -156,44 +200,6 @@ tests_weston = [
linux_explicit_synchronization_unstable_v1_protocol_c, linux_explicit_synchronization_unstable_v1_protocol_c,
] ]
], ],
[
'presentation',
[
presentation_time_client_protocol_h,
presentation_time_protocol_c,
]
],
[
'pointer',
[
'input-timestamps-helper.c',
input_timestamps_unstable_v1_client_protocol_h,
input_timestamps_unstable_v1_protocol_c,
]
],
['subsurface'],
[
'text',
[
text_input_unstable_v1_client_protocol_h,
text_input_unstable_v1_protocol_c,
]
],
[
'touch',
[
'input-timestamps-helper.c',
input_timestamps_unstable_v1_client_protocol_h,
input_timestamps_unstable_v1_protocol_c,
]
],
[
'viewporter',
[
viewporter_client_protocol_h,
viewporter_protocol_c,
]
],
] ]
if get_option('xwayland') if get_option('xwayland')
......
...@@ -31,6 +31,18 @@ ...@@ -31,6 +31,18 @@
#include "input-timestamps-helper.h" #include "input-timestamps-helper.h"
#include "shared/timespec-util.h" #include "shared/timespec-util.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
static const struct timespec t0 = { .tv_sec = 0, .tv_nsec = 100000000 }; static const struct timespec t0 = { .tv_sec = 0, .tv_nsec = 100000000 };
static const struct timespec t1 = { .tv_sec = 1, .tv_nsec = 1000001 }; static const struct timespec t1 = { .tv_sec = 1, .tv_nsec = 1000001 };
......
...@@ -37,6 +37,18 @@ ...@@ -37,6 +37,18 @@
#include "shared/timespec-util.h" #include "shared/timespec-util.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.h"
#include "presentation-time-client-protocol.h" #include "presentation-time-client-protocol.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
static struct wp_presentation * static struct wp_presentation *
get_presentation(struct client *client) get_presentation(struct client *client)
......
...@@ -29,6 +29,18 @@ ...@@ -29,6 +29,18 @@
#include <string.h> #include <string.h>
#include "weston-test-client-helper.h" #include "weston-test-client-helper.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
#define NUM_SUBSURFACES 3 #define NUM_SUBSURFACES 3
......
...@@ -31,6 +31,18 @@ ...@@ -31,6 +31,18 @@
#include "weston-test-client-helper.h" #include "weston-test-client-helper.h"
#include "text-input-unstable-v1-client-protocol.h" #include "text-input-unstable-v1-client-protocol.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
struct text_input_state { struct text_input_state {
int activated; int activated;
......
...@@ -31,6 +31,18 @@ ...@@ -31,6 +31,18 @@
#include "shared/timespec-util.h" #include "shared/timespec-util.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.h"
#include "wayland-server-protocol.h" #include "wayland-server-protocol.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
static const struct timespec t1 = { .tv_sec = 1, .tv_nsec = 1000001 }; static const struct timespec t1 = { .tv_sec = 1, .tv_nsec = 1000001 };
static const struct timespec t2 = { .tv_sec = 2, .tv_nsec = 2000001 }; static const struct timespec t2 = { .tv_sec = 2, .tv_nsec = 2000001 };
......
...@@ -35,6 +35,18 @@ ...@@ -35,6 +35,18 @@
#include "shared/xalloc.h" #include "shared/xalloc.h"
#include "weston-test-client-helper.h" #include "weston-test-client-helper.h"
#include "viewporter-client-protocol.h" #include "viewporter-client-protocol.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);
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP(fixture_setup);
static struct wp_viewporter * static struct wp_viewporter *
get_viewporter(struct client *client) get_viewporter(struct client *client)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment