test: Add include from C++ build test
authorJonas Ådahl <jadahl@gmail.com>
Mon, 24 Mar 2014 22:45:05 +0000 (23:45 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 28 Mar 2014 23:51:44 +0000 (00:51 +0100)
configure.ac
test/Makefile.am
test/build-cxx.cc [new file with mode: 0644]

index afd04a45f1ec632addf69f447d985e762c0c9903..e44adcb31bb64f4f2eb50f3a619615a1362fdca9 100644 (file)
@@ -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"])
 
index e05b8727cff91122280cb852e180cd6dc1680156..e111a124ea228b39bb84056851962bb63efa34b6 100644 (file)
@@ -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 $(AM_CXXFLAGS)
+
 endif
diff --git a/test/build-cxx.cc b/test/build-cxx.cc
new file mode 100644 (file)
index 0000000..c3ad499
--- /dev/null
@@ -0,0 +1,11 @@
+#include <libinput.h>
+
+/* This is a build-test only */
+
+using namespace std;
+
+int
+main(int argc, char **argv)
+{
+       return 0;
+}