test: Add test-driver, minor refactoring
Add the test driver so we can run unit tests with the check target.
Drop GTEST_CPPFLAGS - gtest has proper pkg-config support now.
Default not-found messages are sufficient - use those.
Change-Id: I887f6bc46a029b6b23254da7508745952f865869
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/configure.ac b/configure.ac
index 4a21e8f..95020a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,8 +36,9 @@
# Checks for library functions.
LT_INIT # Removes 'unrecognized options: --with-libtool-sysroot'
# Check/set gtest specific functions.
-AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
-AC_SUBST(GTEST_CPPFLAGS)
+PKG_CHECK_MODULES([GMOCK], [gtest_main],,)
+PKG_CHECK_MODULES([GTEST], [gmock],,)
+AX_PTHREAD
AC_ARG_ENABLE([oe-sdk],
AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
diff --git a/test/Makefile.am b/test/Makefile.am
index 98b521a..eb95144 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,6 +7,8 @@
noinst_PROGRAMS = phosphor-inventory-test
noinst_LTLIBRARIES = libtest.la
+TESTS = ${check_PROGRAMS}
+
extra_yamldir=$(top_srcdir)/example/extra_interfaces.d
phosphor_inventory_test_SOURCES = test.cpp