From 1b894d1755bb756be59251b9384bec0afe373561 Mon Sep 17 00:00:00 2001 From: Taekyun Kim Date: Wed, 8 Apr 2015 15:21:41 +0900 Subject: [PATCH] Add test program template. Add test program name to TESTPROGRAMS variable in test/Makefile.am Change-Id: I888dd46730e2ce0a0fae75028fbe477e08fec8c9 --- Makefile.am | 2 +- configure.ac | 1 + test/Makefile.am | 11 +++++++++++ test/wayland-backend.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/Makefile.am create mode 100644 test/wayland-backend.c diff --git a/Makefile.am b/Makefile.am index 57300c2..b17d8d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = shared src +SUBDIRS = shared src test diff --git a/configure.ac b/configure.ac index 362cd0b..84b60bb 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,7 @@ AC_CONFIG_FILES([ Makefile shared/Makefile src/Makefile +test/Makefile ]) AC_OUTPUT diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..87d3d3a --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,11 @@ +TESTPROGRAMS = wayland-backend + +AM_CFLAGS = -I$(top_srcdir)/src/ \ + -I$(top_srcdir)/src/modules/wayland/ \ + -I$(top_srcdir)/src/modeuls/x11/ \ + -I$(top_srcdir)/src/modules/drm/ + +LDADD = $(top_builddir)/src/libpepper.la $(LIB_PEPPER_LIBS) + +noinst_PROGRAMS = $(TESTPROGRAMS) +TESTS = $(TESTPROGRAMS) diff --git a/test/wayland-backend.c b/test/wayland-backend.c new file mode 100644 index 0000000..2b527b7 --- /dev/null +++ b/test/wayland-backend.c @@ -0,0 +1,28 @@ +#include +#include +#include + +int +main(int argc, char **argv) +{ + pepper_compositor_t *compositor; + pepper_wayland_t *conn; + pepper_output_t *output; + struct wl_display *display; + + compositor = pepper_compositor_create("wayland-1"); + PEPPER_ASSERT(compositor); + + conn = pepper_wayland_connect(compositor, "wayland-0"); + PEPPER_ASSERT(conn); + + output = pepper_wayland_output_create(conn, 640, 480, "pixman"); + PEPPER_ASSERT(output); + + display = pepper_compositor_get_display(compositor); + PEPPER_ASSERT(display); + + wl_display_run(display); + + return 0; +} -- 2.7.4