[PATCH libinput 8/8] test: Add include from C++ build test

Jonas Ådahl jadahl at gmail.com
Tue Mar 25 13:45:59 PDT 2014


---
 configure.ac      |  3 +++
 test/Makefile.am  | 10 +++++++++-
 test/build-cxx.cc | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 test/build-cxx.cc

diff --git a/configure.ac b/configure.ac
index afd04a4..e44adcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,6 +75,9 @@ fi
 if test "x$build_tests" = "xyes" -a "x$HAVE_CHECK" = "xno"; then
        AC_MSG_ERROR([Cannot build tests, check is missing])
 fi
+if test "x$build_tests" = "xyes"; then
+	AC_PROG_CXX
+fi
 
 AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 12ed023..03b4598 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -20,7 +20,11 @@ liblitest_la_SOURCES = \
 	litest.c
 
 run_tests = test-udev test-path test-pointer test-touch test-log test-touchpad
-build_tests = test-build-linker test-build-pedantic-c99 test-build-std-gnuc90
+build_tests = \
+	test-build-cxx \
+	test-build-linker \
+	test-build-pedantic-c99 \
+	test-build-std-gnuc90
 
 noinst_PROGRAMS = $(build_tests) $(run_tests)
 TESTS = $(run_tests)
@@ -67,4 +71,8 @@ test_build_linker_SOURCES = build-pedantic.c
 test_build_linker_CFLAGS = -I$(top_srcdir)/src
 test_build_linker_LDADD = $(top_builddir)/src/libinput.la
 
+# test including from C++
+test_build_cxx_SOURCES = build-cxx.cc
+test_build_cxx_CXXFLAGS = -Wall -Wextra -Wno-unused-parameter
+
 endif
diff --git a/test/build-cxx.cc b/test/build-cxx.cc
new file mode 100644
index 0000000..c3ad499
--- /dev/null
+++ b/test/build-cxx.cc
@@ -0,0 +1,11 @@
+#include <libinput.h>
+
+/* This is a build-test only */
+
+using namespace std;
+
+int
+main(int argc, char **argv)
+{
+	return 0;
+}
-- 
1.8.3.2



More information about the wayland-devel mailing list