From 6f83d0d4a7ef39e0ed04dc0938c59954586e1bc3 Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Tue, 21 Aug 2012 18:28:48 +0200 Subject: [PATCH] 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. --- tests/client-test.c | 2 +- tests/event-test.c | 2 +- tests/test-runner.c | 4 ++-- tests/test-runner.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/client-test.c b/tests/client-test.c index 623163e..979b564 100644 --- a/tests/client-test.c +++ b/tests/client-test.c @@ -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; diff --git a/tests/event-test.c b/tests/event-test.c index ba048d6..e137213 100644 --- a/tests/event-test.c +++ b/tests/event-test.c @@ -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"); diff --git a/tests/test-runner.c b/tests/test-runner.c index e60e006..09c2b1f 100644 --- a/tests/test-runner.c +++ b/tests/test-runner.c @@ -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; diff --git a/tests/test-runner.h b/tests/test-runner.h index ea353bc..88a08cf 100644 --- a/tests/test-runner.h +++ b/tests/test-runner.h @@ -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 -- 2.7.4