summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-11 16:17:57 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-11 16:23:08 -0500
commit783d1f98e32a7ee77db645196ba6843c0b0d9419 (patch)
treefb92fe3b7f2c742c431a44e4e7b1bd5a9c364d7b
parent25d54b5102241117915d18c612ce03cde20d2c5b (diff)
downloadphosphor-inventory-manager-783d1f98e32a7ee77db645196ba6843c0b0d9419.tar.gz
phosphor-inventory-manager-783d1f98e32a7ee77db645196ba6843c0b0d9419.zip
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>
-rw-r--r--configure.ac5
-rw-r--r--test/Makefile.am2
2 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 4a21e8f..95020a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,8 +36,9 @@ AC_CHECK_HEADER(sdbusplus/server.hpp, ,[AC_MSG_ERROR([Could not find sdbusplus/s
# 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 @@ check_PROGRAMS =
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
OpenPOWER on IntegriCloud