[PATCH wayland] tests: add an headers test
Pekka Paalanen
ppaalanen at gmail.com
Thu May 21 00:09:42 PDT 2015
On Wed, 20 May 2015 22:38:53 +0300
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> This test checks that the protocol and library headers include only what
> they are supposed to include. That is, that the core headers do not
> include the protocol headers and that the core protocol headers do not
> include the non core library headers.
> The build process now generates core protocol headers, but they are only
> used in the test and don't get installed.
> ---
> Makefile.am | 15 +++++++++++-
> tests/headers-protocol-core-test.c | 31 +++++++++++++++++++++++
> tests/headers-protocol-test.c | 31 +++++++++++++++++++++++
> tests/headers-test.c | 50 ++++++++++++++++++++++++++++++++++++++
> 4 files changed, 126 insertions(+), 1 deletion(-)
> create mode 100644 tests/headers-protocol-core-test.c
> create mode 100644 tests/headers-protocol-test.c
> create mode 100644 tests/headers-test.c
>
> diff --git a/Makefile.am b/Makefile.am
> index 5b44d6f..0f13fb3 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -50,6 +50,7 @@ libwayland_server_la_SOURCES = \
>
> nodist_libwayland_server_la_SOURCES = \
> protocol/wayland-server-protocol.h \
> + protocol/wayland-server-protocol-core.h \
> protocol/wayland-protocol.c
>
> libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(GCC_CFLAGS) -pthread
> @@ -60,6 +61,7 @@ libwayland_client_la_SOURCES = \
>
> nodist_libwayland_client_la_SOURCES = \
> protocol/wayland-client-protocol.h \
> + protocol/wayland-client-protocol-core.h \
> protocol/wayland-protocol.c
Hi,
I think I'd prefer if these non-installed headers, that building
libwayland-client or -server do not need nor use, would be generated
specifically for the test binary only. Not here.
>
> pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
> @@ -85,6 +87,12 @@ protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
> protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
> $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
>
> +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 < $< > $@
> +
> BUILT_SOURCES = \
> $(nodist_libwayland_server_la_SOURCES) \
> $(nodist_libwayland_client_la_SOURCES)
> @@ -132,7 +140,8 @@ TESTS = \
> queue-test \
> signal-test \
> resources-test \
> - message-test
> + message-test \
> + headers-test
>
> if ENABLE_CPP_TEST
> TESTS += cpp-compile-test
> @@ -188,6 +197,10 @@ 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
> +headers_test_SOURCES = tests/headers-test.c \
> + tests/headers-protocol-test.c \
> + tests/headers-protocol-core-test.c \
> +headers_test_LDADD = libtest-runner.la
I mean that you would add the new nodist sources here instead.
Otherwise this looks fine on a quick glance.
Thanks,
pq
More information about the wayland-devel
mailing list