mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-09 05:58:22 +02:00
tests: Explicitly define the test client to launch
Allow different test clients to launch. The test client is defined by an argument in the test_client_launch() function.
This commit is contained in:
parent
bb5898341c
commit
6f83d0d4a7
4 changed files with 5 additions and 5 deletions
|
|
@ -60,7 +60,7 @@ TEST(client_test)
|
|||
assert(context);
|
||||
context->compositor = compositor;
|
||||
context->done = 0;
|
||||
context->client = test_client_launch(compositor);
|
||||
context->client = test_client_launch(compositor, "test-client");
|
||||
context->client->terminate = 1;
|
||||
|
||||
context->compositor_destroy_listener.notify = compositor_destroy;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ TEST(event_test)
|
|||
struct test_client *client;
|
||||
struct weston_layer *layer;
|
||||
|
||||
client = test_client_launch(compositor);
|
||||
client = test_client_launch(compositor, "test-client");
|
||||
client->terminate = 1;
|
||||
|
||||
test_client_send(client, "create-surface\n");
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ test_client_data(int fd, uint32_t mask, void *data)
|
|||
}
|
||||
|
||||
struct test_client *
|
||||
test_client_launch(struct weston_compositor *compositor)
|
||||
test_client_launch(struct weston_compositor *compositor, const char *file_name)
|
||||
{
|
||||
struct test_client *client;
|
||||
struct wl_event_loop *loop;
|
||||
|
|
@ -87,7 +87,7 @@ test_client_launch(struct weston_compositor *compositor)
|
|||
assert(client_fd >= 0);
|
||||
snprintf(buf, sizeof buf, "%d", client_fd);
|
||||
setenv("TEST_SOCKET", buf, 1);
|
||||
snprintf(buf, sizeof buf, "%s/test-client", getenv("abs_builddir"));
|
||||
snprintf(buf, sizeof buf, "%s/%s", getenv("abs_builddir"), file_name);
|
||||
fprintf(stderr, "launching %s\n", buf);
|
||||
|
||||
client->terminate = 0;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ struct test_client {
|
|||
void *data;
|
||||
};
|
||||
|
||||
struct test_client *test_client_launch(struct weston_compositor *compositor);
|
||||
struct test_client *test_client_launch(struct weston_compositor *compositor, const char *file_name);
|
||||
void test_client_send(struct test_client *client, const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue