summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Arne Petersen <jpetersen@openismus.com>2012-08-21 18:28:48 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-08-29 15:02:18 -0400
commit6f83d0d4a7ef39e0ed04dc0938c59954586e1bc3 (patch)
tree1618fcd3caad2743aff8bc6af2d5f3ff072eb557
parentbb5898341c344d421fce00f479efd66fb14457d3 (diff)
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.
-rw-r--r--tests/client-test.c2
-rw-r--r--tests/event-test.c2
-rw-r--r--tests/test-runner.c4
-rw-r--r--tests/test-runner.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/tests/client-test.c b/tests/client-test.c
index 623163e2..979b564e 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 ba048d61..e137213c 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 e60e0062..09c2b1f9 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 ea353bc7..88a08cfb 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