2 * Copyright © 2012 Intel Corporation
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29 #include "test-runner.h"
33 struct weston_compositor *compositor;
34 struct test_client *client;
35 struct wl_listener compositor_destroy_listener;
41 compositor_destroy(struct wl_listener *listener, void *data)
43 struct context *context =
44 container_of(listener, struct context,
45 compositor_destroy_listener);
47 fprintf(stderr, "notify compositor destroy, status %d, done %d\n",
48 context->client->status, context->client->done);
50 assert(context->client->status == 0);
51 assert(context->client->done);
57 struct context *context;
59 context = malloc(sizeof *context);
61 context->compositor = compositor;
63 context->client = test_client_launch(compositor, "test-client");
64 context->client->terminate = 1;
66 context->compositor_destroy_listener.notify = compositor_destroy;
67 wl_signal_add(&compositor->destroy_signal,
68 &context->compositor_destroy_listener);
70 test_client_send(context->client, "bye\n");