unit-test: Introduce unit tests to phosphor-objmgr

Move a function to make more testable and add a test case for it

Testing: Verified 100% test coverage in processing.cpp

Change-Id: I0a888009cfeb57bbc8ad295681bea00b79f2a23d
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/Makefile.am b/Makefile.am
index caa13dc..62fe99e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,18 @@
+if AUTOCONF_CODE_COVERAGE_2019_01_06
+include $(top_srcdir)/aminclude_static.am
+clean-local: code-coverage-clean
+distclean-local: code-coverage-dist-clean
+else
+@CODE_COVERAGE_RULES@
+endif
+
+AM_LIBS = $(CODE_COVERAGE_LIBS)
+AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) -UNDEBUG $(GTEST_CPPFLAGS)
+AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
+AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
+AM_LDFLAGS = $(GMOCK_LIBS) -lgmock_main \
+	$(GTEST_LIBS) $(OESDK_TESTCASE_FLAGS) $(PTHREAD_LIBS)
+
 sbin_PROGRAMS = mapper mapperx
 
 mapper_SOURCES = libmapper/app.c
@@ -11,7 +26,7 @@
 libmapper_la_LDFLAGS = $(SYSTEMD_LIBS) -version-info 1:0:0 -shared
 libmapper_la_CFLAGS = $(SYSTEMD_CFLAGS)
 
-mapperx_SOURCES = src/main.cpp src/argument.cpp
+mapperx_SOURCES = src/main.cpp src/argument.cpp src/processing.cpp
 mapperx_LDFLAGS = $(SDBUSPLUS_LIBS) -pthread -ltinyxml2
 mapperx_CXXFLAGS = $(SYSTEMD_CFLAGS) -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_ALL_NO_LIB
 
@@ -40,3 +55,13 @@
 endif
 
 SUBDIRS = fail-monitor
+
+check_PROGRAMS =
+XFAIL_TESTS =
+
+# Ignore system headers
+CODE_COVERAGE_IGNORE_PATTERN = '/include/*' '/usr/include/*' '$(includedir)/*'
+
+include src/test/Makefile.am.include
+
+TESTS = $(check_PROGRAMS)