[PATCH wayland 1/2] tests: C++ compilation test

Mariusz Ceier mceier+wayland at gmail.com
Mon Dec 15 02:33:53 PST 2014


This test includes one of wayland headers, which produced
error with C++ compiler. C compiler can't be used for this test,
because it issues only a warning[1] and only when wayland headers
are not installed in system headers path (/usr/include).

[1] wayland-server-protocol.h:201:2: warning: implicit declaration of function ‘wl_resource_post_event’

Signed-off-by: Mariusz Ceier <mceier+wayland at gmail.com>
---
 Makefile.am                | 4 +++-
 configure.ac               | 1 +
 tests/cpp-compile-test.cpp | 5 +++++
 3 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 tests/cpp-compile-test.cpp

diff --git a/Makefile.am b/Makefile.am
index 1551762..ea9ffc1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -128,7 +128,8 @@ TESTS =						\
 	queue-test				\
 	signal-test				\
 	resources-test				\
-	message-test
+	message-test    \
+	cpp-compile-test
 
 check_PROGRAMS =				\
 	$(TESTS)				\
@@ -180,6 +181,7 @@ 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
+cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
 
 fixed_benchmark_SOURCES = tests/fixed-benchmark.c
 fixed_benchmark_LDADD = libtest-runner.la
diff --git a/configure.ac b/configure.ac
index 12dd94c..a5f7e61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,7 @@ AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
 AM_SILENT_RULES([yes])
 
 # Check for programs
+AC_PROG_CXX
 AC_PROG_CC
 
 # Initialize libtool
diff --git a/tests/cpp-compile-test.cpp b/tests/cpp-compile-test.cpp
new file mode 100644
index 0000000..1e84e63
--- /dev/null
+++ b/tests/cpp-compile-test.cpp
@@ -0,0 +1,5 @@
+/* This source should compile fine with C++ compiler */
+#include "wayland-server-protocol.h"
+
+int main() { return 0; }
+
-- 
2.1.3



More information about the wayland-devel mailing list