2012-10-13 01:54:45 +08:00
|
|
|
if BUILD_DOCS
|
2014-03-07 16:00:18 +08:00
|
|
|
SUBDIRS = doc
|
2012-10-13 01:54:45 +08:00
|
|
|
endif
|
|
|
|
|
2010-11-06 08:55:27 +08:00
|
|
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
2011-02-15 11:17:41 +08:00
|
|
|
|
2015-06-18 04:13:48 +08:00
|
|
|
AM_CPPFLAGS = \
|
|
|
|
-I$(top_builddir)/src \
|
|
|
|
-I$(top_srcdir)/src \
|
|
|
|
-I$(top_builddir)/protocol
|
|
|
|
|
2015-06-18 04:13:49 +08:00
|
|
|
AM_CFLAGS = $(GCC_CFLAGS)
|
2015-06-18 04:13:48 +08:00
|
|
|
|
2011-02-15 11:17:41 +08:00
|
|
|
aclocaldir = $(datadir)/aclocal
|
2013-07-02 17:38:15 +08:00
|
|
|
dist_aclocal_DATA = wayland-scanner.m4
|
2011-02-24 17:53:06 +08:00
|
|
|
|
2014-02-19 06:55:09 +08:00
|
|
|
dist_pkgdata_DATA = \
|
|
|
|
wayland-scanner.mk \
|
2015-11-09 12:14:59 +08:00
|
|
|
protocol/wayland.xml \
|
|
|
|
protocol/wayland.dtd
|
2014-03-07 15:15:02 +08:00
|
|
|
|
2014-03-07 15:45:56 +08:00
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
|
|
pkgconfig_DATA =
|
|
|
|
|
2015-06-18 04:13:50 +08:00
|
|
|
bin_PROGRAMS = wayland-scanner
|
|
|
|
wayland_scanner_SOURCES = src/scanner.c
|
|
|
|
wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
|
|
|
|
wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
|
|
|
|
pkgconfig_DATA += src/wayland-scanner.pc
|
2015-07-02 05:51:01 +08:00
|
|
|
|
|
|
|
if USE_HOST_SCANNER
|
2015-06-18 04:13:50 +08:00
|
|
|
wayland_scanner = wayland-scanner
|
2015-07-02 05:51:01 +08:00
|
|
|
else
|
|
|
|
$(BUILT_SOURCES) : wayland-scanner
|
|
|
|
wayland_scanner = $(top_builddir)/wayland-scanner
|
2015-06-18 04:13:50 +08:00
|
|
|
endif
|
|
|
|
|
2015-06-19 00:27:21 +08:00
|
|
|
libwayland_util_la_CFLAGS = $(AM_CFLAGS)
|
2015-06-18 04:13:50 +08:00
|
|
|
libwayland_util_la_SOURCES = \
|
|
|
|
src/wayland-util.c \
|
2015-06-18 04:13:51 +08:00
|
|
|
src/wayland-util.h
|
2015-06-18 04:13:50 +08:00
|
|
|
|
2014-03-07 15:45:56 +08:00
|
|
|
noinst_LTLIBRARIES = libwayland-util.la
|
|
|
|
|
2015-06-18 04:13:50 +08:00
|
|
|
if ENABLE_LIBRARIES
|
2015-06-19 06:47:22 +08:00
|
|
|
noinst_LTLIBRARIES += libwayland-private.la
|
2015-06-18 04:13:50 +08:00
|
|
|
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
|
|
|
|
|
2015-06-19 06:47:22 +08:00
|
|
|
libwayland_private_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS)
|
|
|
|
libwayland_private_la_SOURCES = \
|
2015-06-18 04:13:51 +08:00
|
|
|
src/connection.c \
|
|
|
|
src/wayland-os.c \
|
|
|
|
src/wayland-os.h \
|
|
|
|
src/wayland-private.h
|
|
|
|
|
2014-03-07 15:45:56 +08:00
|
|
|
include_HEADERS = \
|
|
|
|
src/wayland-util.h \
|
|
|
|
src/wayland-server.h \
|
2015-04-29 21:34:47 +08:00
|
|
|
src/wayland-server-core.h \
|
2014-03-07 15:45:56 +08:00
|
|
|
src/wayland-client.h \
|
2015-04-29 21:34:47 +08:00
|
|
|
src/wayland-client-core.h \
|
2014-03-07 15:45:56 +08:00
|
|
|
src/wayland-egl.h \
|
2015-04-29 03:57:18 +08:00
|
|
|
src/wayland-egl-core.h \
|
2014-03-07 15:45:56 +08:00
|
|
|
src/wayland-version.h
|
|
|
|
|
2014-05-07 20:09:35 +08:00
|
|
|
nodist_include_HEADERS = \
|
|
|
|
protocol/wayland-server-protocol.h \
|
|
|
|
protocol/wayland-client-protocol.h
|
|
|
|
|
2015-06-19 00:27:21 +08:00
|
|
|
libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
|
2015-06-19 06:47:22 +08:00
|
|
|
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la -lrt -lm
|
2014-03-07 15:45:56 +08:00
|
|
|
libwayland_server_la_LDFLAGS = -version-info 1:0:1
|
|
|
|
libwayland_server_la_SOURCES = \
|
|
|
|
src/wayland-server.c \
|
|
|
|
src/wayland-shm.c \
|
|
|
|
src/event-loop.c
|
|
|
|
|
|
|
|
nodist_libwayland_server_la_SOURCES = \
|
2014-03-10 20:03:57 +08:00
|
|
|
protocol/wayland-server-protocol.h \
|
2014-03-07 15:45:56 +08:00
|
|
|
protocol/wayland-protocol.c
|
|
|
|
|
2015-06-19 00:27:21 +08:00
|
|
|
libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
|
2015-06-19 06:47:22 +08:00
|
|
|
libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la -lrt -lm
|
2014-06-20 15:29:52 +08:00
|
|
|
libwayland_client_la_LDFLAGS = -version-info 3:0:3
|
2014-03-07 15:45:56 +08:00
|
|
|
libwayland_client_la_SOURCES = \
|
|
|
|
src/wayland-client.c
|
|
|
|
|
|
|
|
nodist_libwayland_client_la_SOURCES = \
|
2014-03-10 20:03:57 +08:00
|
|
|
protocol/wayland-client-protocol.h \
|
2014-03-07 15:45:56 +08:00
|
|
|
protocol/wayland-protocol.c
|
|
|
|
|
|
|
|
pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
|
|
|
|
|
|
|
|
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
|
|
|
|
|
|
|
|
protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
|
2014-03-07 15:15:02 +08:00
|
|
|
|
2014-03-07 15:45:56 +08:00
|
|
|
protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
|
|
|
|
|
2015-05-22 01:43:13 +08:00
|
|
|
protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header -c < $< > $@
|
|
|
|
|
|
|
|
protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header -c < $< > $@
|
|
|
|
|
2014-03-07 15:45:56 +08:00
|
|
|
BUILT_SOURCES = \
|
|
|
|
$(nodist_libwayland_server_la_SOURCES) \
|
2015-05-22 01:43:13 +08:00
|
|
|
$(nodist_libwayland_client_la_SOURCES) \
|
|
|
|
$(nodist_headers_test_SOURCES)
|
2014-03-07 15:45:56 +08:00
|
|
|
|
2015-05-28 23:19:09 +08:00
|
|
|
CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
|
2014-03-07 15:45:56 +08:00
|
|
|
DISTCLEANFILES = src/wayland-version.h
|
|
|
|
EXTRA_DIST = src/wayland-version.h.in
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib_LTLIBRARIES += libwayland-cursor.la
|
|
|
|
|
|
|
|
include_HEADERS += cursor/wayland-cursor.h
|
2014-03-07 15:15:02 +08:00
|
|
|
|
|
|
|
libwayland_cursor_la_SOURCES = \
|
|
|
|
cursor/wayland-cursor.c \
|
|
|
|
cursor/os-compatibility.c \
|
|
|
|
cursor/os-compatibility.h \
|
|
|
|
cursor/cursor-data.h \
|
|
|
|
cursor/xcursor.c \
|
|
|
|
cursor/xcursor.h
|
2014-03-07 15:45:56 +08:00
|
|
|
libwayland_cursor_la_LIBADD = libwayland-client.la
|
2014-03-07 15:15:02 +08:00
|
|
|
|
2014-03-07 15:45:56 +08:00
|
|
|
pkgconfig_DATA += cursor/wayland-cursor.pc
|
2014-03-07 15:15:02 +08:00
|
|
|
|
|
|
|
libwayland_cursor_la_CFLAGS = \
|
2015-06-19 00:27:21 +08:00
|
|
|
$(AM_CFLAGS) \
|
2014-03-07 15:15:02 +08:00
|
|
|
-I$(top_builddir)/src \
|
|
|
|
-I$(top_srcdir)/src \
|
|
|
|
-DICONDIR=\"$(ICONDIR)\"
|
2014-03-07 16:00:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
TESTS = \
|
|
|
|
array-test \
|
|
|
|
client-test \
|
|
|
|
display-test \
|
|
|
|
connection-test \
|
|
|
|
event-loop-test \
|
|
|
|
fixed-test \
|
|
|
|
list-test \
|
|
|
|
map-test \
|
|
|
|
os-wrappers-test \
|
|
|
|
sanity-test \
|
|
|
|
socket-test \
|
|
|
|
queue-test \
|
|
|
|
signal-test \
|
2014-05-09 05:39:48 +08:00
|
|
|
resources-test \
|
2015-05-22 01:43:13 +08:00
|
|
|
message-test \
|
|
|
|
headers-test
|
2014-03-07 16:00:18 +08:00
|
|
|
|
2014-12-15 18:33:53 +08:00
|
|
|
if ENABLE_CPP_TEST
|
|
|
|
TESTS += cpp-compile-test
|
|
|
|
endif
|
|
|
|
|
2014-03-07 16:00:18 +08:00
|
|
|
check_PROGRAMS = \
|
|
|
|
$(TESTS) \
|
|
|
|
exec-fd-leak-checker
|
|
|
|
|
|
|
|
noinst_PROGRAMS = \
|
|
|
|
fixed-benchmark
|
|
|
|
|
|
|
|
check_LTLIBRARIES = libtest-runner.la
|
|
|
|
|
|
|
|
libtest_runner_la_SOURCES = \
|
|
|
|
tests/test-runner.c \
|
|
|
|
tests/test-runner.h \
|
tests: add test-compositor
This patch introduces a set of functions that can create a display
and clients for tests.
On server side the user can use functions:
display_create()
display_destroy()
create_client()
display_run()
display_resume()
and on client side the user can use:
client_connect()
client_disconnect()
stop_display()
The stop_display() and display_resume() are functions that serve as a barrier
and also allow the display to take some action after the display_run() was called,
because after the display is stopped, it can run arbitrary code until it calls
display_resume().
client_connect() function connects to wayland display and creates a proxy to
test_compositor global object, so it can ask for stopping the display later
using stop_display().
An example:
void
client_main()
{
/* or client can use wl_display_connect(NULL)
* and do all the stuff manually */
struct client *c = client_connect();
/* do some stuff, ... */
/* stop the display so that it can
* do some other stuff */
stop_display(c, 1);
/* ... */
client_disconnect(c);
}
TEST(dummy_tst)
{
struct display *d = display_create();
/* set up the display */
wl_global_create(d->wl_display, ...);
/* ... */
create_client(d, client_main);
display_run();
/* if we are here, the display has been stopped
* and we can do some code, i. e. create another global or so */
wl_global_create(d->wl_display, ...);
/* ... */
display_resume(d); /* resume display and clients */
display_destroy(d);
}
v2:
added/changed message in few asserts that were not clear
fixed codying style issues and typo
client_create_with_name: fixed a condition in an assert
get_socket_name: use also pid
check_error: fix errno -> err
[Pekka Paalanen: added test-compositor.h to SOURCES, added
WL_HIDE_DEPRECATED to get rid of deprecated defs and lots of warnings,
fixed one unchecked return value from write().]
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-21 22:52:16 +08:00
|
|
|
tests/test-helpers.c \
|
|
|
|
tests/test-compositor.h \
|
|
|
|
tests/test-compositor.c
|
2014-03-07 16:00:18 +08:00
|
|
|
libtest_runner_la_LIBADD = \
|
2015-06-19 06:47:22 +08:00
|
|
|
libwayland-private.la \
|
2014-03-07 16:00:18 +08:00
|
|
|
libwayland-util.la \
|
|
|
|
libwayland-client.la \
|
|
|
|
libwayland-server.la \
|
|
|
|
-lrt -ldl $(FFI_LIBS)
|
|
|
|
|
|
|
|
|
|
|
|
array_test_SOURCES = tests/array-test.c
|
|
|
|
array_test_LDADD = libtest-runner.la
|
|
|
|
client_test_SOURCES = tests/client-test.c
|
|
|
|
client_test_LDADD = libtest-runner.la
|
|
|
|
display_test_SOURCES = tests/display-test.c
|
|
|
|
display_test_LDADD = libtest-runner.la
|
|
|
|
connection_test_SOURCES = tests/connection-test.c
|
|
|
|
connection_test_LDADD = libtest-runner.la
|
|
|
|
event_loop_test_SOURCES = tests/event-loop-test.c
|
|
|
|
event_loop_test_LDADD = libtest-runner.la
|
|
|
|
fixed_test_SOURCES = tests/fixed-test.c
|
|
|
|
fixed_test_LDADD = libtest-runner.la
|
|
|
|
list_test_SOURCES = tests/list-test.c
|
|
|
|
list_test_LDADD = libtest-runner.la
|
|
|
|
map_test_SOURCES = tests/map-test.c
|
|
|
|
map_test_LDADD = libtest-runner.la
|
|
|
|
sanity_test_SOURCES = tests/sanity-test.c
|
|
|
|
sanity_test_LDADD = libtest-runner.la
|
|
|
|
socket_test_SOURCES = tests/socket-test.c
|
|
|
|
socket_test_LDADD = libtest-runner.la
|
|
|
|
queue_test_SOURCES = tests/queue-test.c
|
|
|
|
queue_test_LDADD = libtest-runner.la
|
|
|
|
signal_test_SOURCES = tests/signal-test.c
|
|
|
|
signal_test_LDADD = libtest-runner.la
|
|
|
|
resources_test_SOURCES = tests/resources-test.c
|
|
|
|
resources_test_LDADD = libtest-runner.la
|
2014-05-09 05:39:48 +08:00
|
|
|
message_test_SOURCES = tests/message-test.c
|
|
|
|
message_test_LDADD = libtest-runner.la
|
2015-05-22 01:43:13 +08:00
|
|
|
headers_test_SOURCES = tests/headers-test.c \
|
|
|
|
tests/headers-protocol-test.c \
|
|
|
|
tests/headers-protocol-core-test.c
|
|
|
|
headers_test_LDADD = libtest-runner.la
|
|
|
|
nodist_headers_test_SOURCES = \
|
|
|
|
protocol/wayland-server-protocol-core.h \
|
|
|
|
protocol/wayland-client-protocol-core.h
|
2014-03-07 16:00:18 +08:00
|
|
|
|
2014-12-15 18:33:53 +08:00
|
|
|
if ENABLE_CPP_TEST
|
|
|
|
cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
|
|
|
|
endif
|
|
|
|
|
2014-03-07 16:00:18 +08:00
|
|
|
fixed_benchmark_SOURCES = tests/fixed-benchmark.c
|
2014-03-11 08:01:47 +08:00
|
|
|
fixed_benchmark_LDADD = libtest-runner.la
|
2014-03-07 16:00:18 +08:00
|
|
|
|
|
|
|
os_wrappers_test_SOURCES = tests/os-wrappers-test.c
|
|
|
|
os_wrappers_test_LDADD = libtest-runner.la
|
|
|
|
|
|
|
|
exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
|
|
|
|
exec_fd_leak_checker_LDADD = libtest-runner.la
|
2015-06-19 06:47:22 +08:00
|
|
|
endif #ENABLE_LIBRARIES
|