wayland/Makefile.am

342 lines
9.8 KiB
Makefile
Raw Normal View History

if BUILD_DOCS
SUBDIRS = doc
endif
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_CPPFLAGS = \
-I$(top_builddir)/src \
-I$(top_srcdir)/src \
-I$(top_builddir)/protocol
AM_CFLAGS = $(GCC_CFLAGS)
aclocaldir = $(datadir)/aclocal
dist_aclocal_DATA = wayland-scanner.m4
dist_pkgdata_DATA = \
wayland-scanner.mk \
protocol/wayland.xml \
protocol/wayland.dtd
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
bin_PROGRAMS = wayland-scanner
wayland_scanner_SOURCES = src/scanner.c
wayland_scanner_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(LIBXML_CFLAGS) $(AM_CFLAGS)
wayland_scanner_LDADD = $(EXPAT_LIBS) $(LIBXML_LIBS) libwayland-util.la
pkgconfig_DATA += src/wayland-scanner.pc
if DTD_VALIDATION
wayland_scanner_SOURCES += src/dtddata.S
endif
src/dtddata.o: protocol/wayland.dtd
if USE_HOST_SCANNER
wayland_scanner = wayland-scanner
else
$(BUILT_SOURCES) : wayland-scanner
wayland_scanner = $(top_builddir)/wayland-scanner
endif
libwayland_util_la_CFLAGS = $(AM_CFLAGS)
libwayland_util_la_SOURCES = \
src/wayland-util.c \
src/wayland-util.h
noinst_LTLIBRARIES = libwayland-util.la
if ENABLE_LIBRARIES
noinst_LTLIBRARIES += libwayland-private.la
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
libwayland_private_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS)
libwayland_private_la_SOURCES = \
src/connection.c \
src/wayland-os.c \
src/wayland-os.h \
src/wayland-private.h \
src/wayland-server-private.h
include_HEADERS = \
src/wayland-util.h \
src/wayland-server.h \
src/wayland-server-core.h \
src/wayland-client.h \
src/wayland-client-core.h \
src/wayland-version.h
Do not distribute generated headers The wayland-server-protocol.h and wayland-client-protocol.h headers are currently being shipped in tarballs created using make dist. This causes out-of-tree builds to fail since make will detect that the headers exist by looking at the source directory (via VPATH) and not regenerate them. But as opposed to ${top_builddir}/protocol, ${top_srcdir}/protocol is not part of the include path and therefore the shipped files can't be found during compilation. Two solutions exist to this problem: 1) add ${top_srcdir}/protocol to the include path to allow shipped files to be used if available or 2) don't ship these generated files in release tarballs. The latter seems the most appropriate. wayland-scanner is already a prerequisite in order to generate wayland-protocol.c, so it is either built as part of the package or provided externally. Generating all files from the protocol definition at build time also ensures that they don't get out of sync. Both of the generated headers are already listed in Makefile.am as nodist_*_SOURCES, but at the same time they appear in include_HEADERS, which will cause them to be added to the list of distributable files after all. To prevent that, split them off into nodist_include_HEADERS. Note that this problem will be hidden if a previous version of wayland has been installed, since these files will exist in /usr/include and be included from there. So this build error will only show for out-of-tree builds on systems that don't have wayland installed yet. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-05-07 20:09:35 +08:00
nodist_include_HEADERS = \
protocol/wayland-server-protocol.h \
protocol/wayland-client-protocol.h
libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la $(RT_LIBS) -lm
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 = \
protocol/wayland-server-protocol.h \
protocol/wayland-protocol.c
libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la $(RT_LIBS) -lm
libwayland_client_la_LDFLAGS = -version-info 3:0:3
libwayland_client_la_SOURCES = \
src/wayland-client.c
nodist_libwayland_client_la_SOURCES = \
protocol/wayland-client-protocol.h \
protocol/wayland-protocol.c
pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
if USE_HOST_SCANNER
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s code $< $@
else
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s public-code $< $@
endif
protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s server-header $< $@
protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s client-header $< $@
protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s server-header -c < $< > $@
protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s client-header -c < $< > $@
BUILT_SOURCES = \
$(nodist_libwayland_server_la_SOURCES) \
$(nodist_libwayland_client_la_SOURCES) \
$(nodist_headers_test_SOURCES) \
$(nodist_display_test_SOURCES)
CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
DISTCLEANFILES = src/wayland-version.h
EXTRA_DIST = CONTRIBUTING.md
lib_LTLIBRARIES += libwayland-cursor.la
include_HEADERS += cursor/wayland-cursor.h
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
libwayland_cursor_la_LIBADD = libwayland-client.la
pkgconfig_DATA += cursor/wayland-cursor.pc
libwayland_cursor_la_CFLAGS = \
$(AM_CFLAGS) \
-I$(top_builddir)/src \
-I$(top_srcdir)/src \
-DICONDIR=\"$(ICONDIR)\"
lib_LTLIBRARIES += libwayland-egl.la
include_HEADERS += egl/wayland-egl.h
include_HEADERS += egl/wayland-egl-core.h
libwayland_egl_la_SOURCES = egl/wayland-egl.c
libwayland_egl_la_LDFLAGS = -version-info 1
pkgconfig_DATA += egl/wayland-egl.pc
## XXX: backend interface
include_HEADERS += egl/wayland-egl-backend.h
pkgconfig_DATA += egl/wayland-egl-backend.pc
built_test_programs = \
array-test \
client-test \
display-test \
connection-test \
event-loop-test \
fixed-test \
interface-test \
list-test \
map-test \
os-wrappers-test \
sanity-test \
socket-test \
queue-test \
proxy: Add API to tag proxy objects When an application and a toolkit share the same Wayland connection, it will receive events with each others objects. For example if the toolkit manages a set of surfaces, and the application another set, if both the toolkit and application listen to pointer focus events, they'll receive focus events for each others surfaces. In order for the toolkit and application layers to identify whether a surface is managed by itself or not, it cannot only rely on retrieving the proxy user data, without going through all it's own proxy objects finding whether it's one of them. By adding the ability to "tag" a proxy object, the toolkit and application can use the tag to identify what the user data pointer points to something known. To create a tag, the recommended way is to define a statically allocated constant char array containing some descriptive string. The tag will be the pointer to the non-const pointer to the beginning of the array. For example, to identify whether a focus event is for a surface managed by the code in question: static const char *my_tag = "my tag"; static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) { struct window *window; const char * const *tag; tag = wl_proxy_get_tag((struct wl_proxy *) surface); if (tag != &my_tag) return; window = wl_surface_get_user_data(surface); ... } ... static void init_window_surface(struct window *window) { struct wl_surface *surface; surface = wl_compositor_create_surface(compositor); wl_surface_set_user_data(surface, window); wl_proxy_set_tag((struct wl_proxy *) surface, &my_tag); } Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2019-07-10 15:13:33 +08:00
proxy-test \
signal-test \
newsignal-test \
resources-test \
message-test \
headers-test \
compositor-introspection-test \
protocol-logger-test \
wayland-egl-abi-check
EXTRA_DIST += egl/wayland-egl-symbols-check
check_PROGRAMS = wayland-egl-abi-check
wayland_egl_abi_check_SOURCES = egl/wayland-egl-abi-check.c
if ENABLE_CPP_TEST
built_test_programs += cpp-compile-test
endif
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
AM_TESTS_ENVIRONMENT = \
export WAYLAND_SCANNER='$(top_builddir)/wayland-scanner' \
TEST_DATA_DIR='$(top_srcdir)/tests/data' \
TEST_OUTPUT_DIR='$(top_builddir)/tests/output' \
WAYLAND_EGL_LIB='$(top_builddir)/.libs/libwayland-egl.so' \
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
SED=$(SED) \
NM='$(NM)' \
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
;
TESTS = $(built_test_programs) \
egl/wayland-egl-symbols-check \
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
tests/scanner-test.sh
noinst_PROGRAMS = \
$(built_test_programs) \
exec-fd-leak-checker \
fixed-benchmark
tests: fix main symbol duplication So far I got these errors before patching: libtool: link: cc -o .libs/headers-test -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/headers-test.o tests/headers-protocol-test.o tests/headers-protocol-core-test.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at headers-test.c:53 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/headers-test.c:53) >>> tests/headers-test.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a libtool: link: cc -o .libs/exec-fd-leak-checker -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/exec-fd-leak-checker.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at exec-fd-leak-checker.c:57 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/exec-fd-leak-checker.c:57) >>> tests/exec-fd-leak-checker.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a Makefile.am: error: object 'tests/test-helpers.$(OBJEXT)' created both with libtool and without libtool: link: cc -o .libs/fixed-benchmark -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/fixed-benchmark.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at fixed-benchmark.c:100 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/fixed-benchmark.c:100) >>> tests/fixed-benchmark.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a This commit fixes all of that. Signed-off-by: Leonid Bobrov <mazocomp@disroot.org> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-13 19:39:06 +08:00
noinst_LTLIBRARIES += \
libtest-runner.la \
libtest-helpers.la
libtest_helpers_la_SOURCES = tests/test-helpers.c
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-compositor.h \
tests/test-compositor.c
libtest_runner_la_LIBADD = \
libwayland-private.la \
libwayland-util.la \
libwayland-client.la \
libwayland-server.la \
tests: fix main symbol duplication So far I got these errors before patching: libtool: link: cc -o .libs/headers-test -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/headers-test.o tests/headers-protocol-test.o tests/headers-protocol-core-test.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at headers-test.c:53 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/headers-test.c:53) >>> tests/headers-test.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a libtool: link: cc -o .libs/exec-fd-leak-checker -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/exec-fd-leak-checker.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at exec-fd-leak-checker.c:57 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/exec-fd-leak-checker.c:57) >>> tests/exec-fd-leak-checker.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a Makefile.am: error: object 'tests/test-helpers.$(OBJEXT)' created both with libtool and without libtool: link: cc -o .libs/fixed-benchmark -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/fixed-benchmark.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at fixed-benchmark.c:100 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/fixed-benchmark.c:100) >>> tests/fixed-benchmark.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a This commit fixes all of that. Signed-off-by: Leonid Bobrov <mazocomp@disroot.org> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-13 19:39:06 +08:00
libtest-helpers.la \
$(RT_LIBS) $(DL_LIBS) $(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_CFLAGS = -pthread
display_test_SOURCES = tests/display-test.c
display_test_LDADD = libtest-runner.la
nodist_display_test_SOURCES = \
protocol/tests-server-protocol.h \
protocol/tests-client-protocol.h \
protocol/tests-protocol.c
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
interface_test_SOURCES = tests/interface-test.c
interface_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
proxy: Add API to tag proxy objects When an application and a toolkit share the same Wayland connection, it will receive events with each others objects. For example if the toolkit manages a set of surfaces, and the application another set, if both the toolkit and application listen to pointer focus events, they'll receive focus events for each others surfaces. In order for the toolkit and application layers to identify whether a surface is managed by itself or not, it cannot only rely on retrieving the proxy user data, without going through all it's own proxy objects finding whether it's one of them. By adding the ability to "tag" a proxy object, the toolkit and application can use the tag to identify what the user data pointer points to something known. To create a tag, the recommended way is to define a statically allocated constant char array containing some descriptive string. The tag will be the pointer to the non-const pointer to the beginning of the array. For example, to identify whether a focus event is for a surface managed by the code in question: static const char *my_tag = "my tag"; static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) { struct window *window; const char * const *tag; tag = wl_proxy_get_tag((struct wl_proxy *) surface); if (tag != &my_tag) return; window = wl_surface_get_user_data(surface); ... } ... static void init_window_surface(struct window *window) { struct wl_surface *surface; surface = wl_compositor_create_surface(compositor); wl_surface_set_user_data(surface, window); wl_proxy_set_tag((struct wl_proxy *) surface, &my_tag); } Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2019-07-10 15:13:33 +08:00
proxy_test_SOURCES = tests/proxy-test.c
proxy_test_LDADD = libtest-runner.la
signal_test_SOURCES = tests/signal-test.c
signal_test_LDADD = libtest-runner.la
# wayland-server.c is needed here to access wl_priv_* functions
newsignal_test_SOURCES = tests/newsignal-test.c src/wayland-server.c
newsignal_test_LDADD = libtest-runner.la
resources_test_SOURCES = tests/resources-test.c
resources_test_LDADD = libtest-runner.la
message_test_SOURCES = tests/message-test.c
message_test_LDADD = libtest-runner.la
compositor_introspection_test_SOURCES = tests/compositor-introspection-test.c
compositor_introspection_test_LDADD = libtest-runner.la
protocol_logger_test_SOURCES = tests/protocol-logger-test.c
protocol_logger_test_LDADD = libtest-runner.la
headers_test_SOURCES = tests/headers-test.c \
tests/headers-protocol-test.c \
tests/headers-protocol-core-test.c
nodist_headers_test_SOURCES = \
protocol/wayland-server-protocol-core.h \
protocol/wayland-client-protocol-core.h
if ENABLE_CPP_TEST
cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
endif
fixed_benchmark_SOURCES = tests/fixed-benchmark.c
fixed_benchmark_LDADD = $(RT_LIBS)
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
tests: fix main symbol duplication So far I got these errors before patching: libtool: link: cc -o .libs/headers-test -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/headers-test.o tests/headers-protocol-test.o tests/headers-protocol-core-test.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at headers-test.c:53 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/headers-test.c:53) >>> tests/headers-test.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a libtool: link: cc -o .libs/exec-fd-leak-checker -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/exec-fd-leak-checker.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at exec-fd-leak-checker.c:57 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/exec-fd-leak-checker.c:57) >>> tests/exec-fd-leak-checker.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a Makefile.am: error: object 'tests/test-helpers.$(OBJEXT)' created both with libtool and without libtool: link: cc -o .libs/fixed-benchmark -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/fixed-benchmark.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib ld: error: duplicate symbol: main >>> defined at fixed-benchmark.c:100 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/fixed-benchmark.c:100) >>> tests/fixed-benchmark.o:(main) >>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377) >>> test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a This commit fixes all of that. Signed-off-by: Leonid Bobrov <mazocomp@disroot.org> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-13 19:39:06 +08:00
exec_fd_leak_checker_LDADD = libtest-helpers.la
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
EXTRA_DIST += tests/scanner-test.sh \
protocol/tests.xml \
tests/data/bad-identifier-arg.xml \
tests/data/bad-identifier-entry.xml \
tests/data/bad-identifier-enum.xml \
tests/data/bad-identifier-event.xml \
tests/data/bad-identifier-interface.xml \
tests/data/bad-identifier-protocol.xml \
tests/data/bad-identifier-request.xml \
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
tests/data/example.xml \
tests/data/example-client.h \
tests/data/example-server.h \
tests/data/example-code.c \
tests/data/small.xml \
tests/data/small-code.c \
tests/data/small-client.h \
tests/data/small-server.h \
tests/data/small-code-core.c \
tests/data/small-client-core.h \
tests/data/small-server-core.h \
tests/data/small-private-code.c \
meson.build \
meson_options.txt \
cursor/meson.build \
doc/meson.build \
doc/doxygen/mainpage.dox \
doc/doxygen/meson.build \
doc/doxygen/gen-doxygen.py \
doc/doxygen/xml/meson.build \
doc/doxygen/xml/Client/meson.build \
doc/doxygen/xml/Server/meson.build \
doc/publican/meson.build \
doc/publican/sources/meson.build \
egl/meson.build \
src/meson.build \
tests/meson.build
tests: add scanner tests Add tests that ensure that wayland-scanner output for a given input does not change unexpectedly. This makes it very easy to review wayland-scanner patches. Before, when patches were proposed for wayland-scanner, I had to build wayland without the patches, save the generated files into a temporary directory, apply the patches, build again, and diff the old vs. new generated file. No more. Now whenever someone makes intentional changes to wayland-scanner's output, he will also have to patch the example output files to match. That means that reviewers see the diff of the generated files straight from the patch itself. Verifying the diff is true is as easy as 'make check'. The tests use separate example XML files instead of wayland.xml directly, so that wayland.xml can be updated without fixing scanner tests, avoiding the churn. example.xml starts as a copy of wayland.xml. If wayland.xml starts using new wayland-scanner features, they should be copied into example.xml again to be covered by the tests. This patch relies on the previous patch to actually add all the data files for input and reference output. The scanner output is fed through sed to remove parts that are allowed to vary: the scanner version string. v2: no need for scanner-test.sh to depend on the test data Task: https://phabricator.freedesktop.org/T3313 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1) Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-09-30 20:12:47 +08:00
tests/scanner-test.sh: $(top_builddir)/wayland-scanner
clean-local:
-rm -rf tests/output
endif #ENABLE_LIBRARIES