build: run testcases via autotools

Change-Id: Ie2aec28bac16388cef39558746dfe6ce8cba199e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/Makefile.am b/Makefile.am
index 07076d7..046ee20 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,3 +14,5 @@
 	sdbusplus/utility/tuple_to_array.hpp \
 	sdbusplus/utility/type_traits.hpp \
 	sdbusplus/vtable.hpp
+
+SUBDIRS = test
diff --git a/configure.ac b/configure.ac
index cc8de8a..7c491d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,7 @@
 AM_SILENT_RULES([yes])
 
 # Checks for programs.
+AC_PROG_CXX
 AC_PROG_CC
 AM_PROG_AR
 AC_PROG_INSTALL
@@ -18,7 +19,9 @@
 AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd developement package required])])
 
 # Checks for typedefs, structures, and compiler characteristics.
-AX_APPEND_COMPILE_FLAGS([-fpic -Wall -Werror], [CFLAGS])
+AX_CXX_COMPILE_STDCXX_14([noext])
+AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CFLAGS])
+AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
 
 # Checks for library functions.
 LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
@@ -46,5 +49,5 @@
 )
 
 # Create configured output
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile test/Makefile])
 AC_OUTPUT
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..f7c41bd
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,26 @@
+check_PROGRAMS =
+
+TESTS = $(check_PROGRAMS)
+
+check_PROGRAMS += message_append
+message_append_CXXFLAGS = $(SYSTEMD_CFLAGS) $(PTHREAD_CFLAGS)
+message_append_LDFLAGS = $(SYSTEMD_LIBS) $(PTHREAD_LIBS)
+message_append_SOURCES = message/append.cpp
+
+check_PROGRAMS += message_read
+message_read_CXXFLAGS = $(SYSTEMD_CFLAGS) $(PTHREAD_CFLAGS)
+message_read_LDFLAGS = $(SYSTEMD_LIBS) $(PTHREAD_LIBS)
+message_read_SOURCES = message/read.cpp
+
+check_PROGRAMS += message_types
+message_types_SOURCES = message/types.cpp
+
+check_PROGRAMS += utility_tuple_to_array
+utility_tuple_to_array_SOURCES = utility/tuple_to_array.cpp
+
+check_PROGRAMS += utility_type_traits
+utility_type_traits_SOURCES = utility/type_traits.cpp
+
+check_PROGRAMS += vtable_vtable
+vtable_vtable_SOURCES = vtable/vtable.cpp vtable/vtable_c.c
+