test: add mock build test
Avoid breaking downstream dependencies by building the mocks that are
exported.
Change-Id: If171910dcff4fdd90d88d7aa611891c9c3fc4b85
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/Makefile.am b/test/Makefile.am
index bf76b45..543e1b9 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -28,3 +28,8 @@
crc_unittest_CPPFLAGS = $(gtest_cppflags)
crc_unittest_LDADD = $(gtest_ldadd)
crc_unittest_LDADD += $(top_builddir)/src/libipmiblob.la
+
+check_PROGRAMS += mocks_unittest
+mocks_unittest_SOURCES = build_mocks.cpp
+mocks_unittest_CPPFLAGS = $(gtest_cppflags)
+mocks_unittest_LDADD = $(gtest_ldadd)
diff --git a/test/build_mocks.cpp b/test/build_mocks.cpp
new file mode 100644
index 0000000..3030317
--- /dev/null
+++ b/test/build_mocks.cpp
@@ -0,0 +1,17 @@
+#include <ipmiblob/test/blob_interface_mock.hpp>
+#include <ipmiblob/test/crc_mock.hpp>
+#include <ipmiblob/test/ipmi_interface_mock.hpp>
+
+#include <gtest/gtest.h>
+
+namespace ipmiblob
+{
+
+TEST(BuildMockObjects, buildAllMocks)
+{
+ BlobInterfaceMock blobMock;
+ CrcMock crcMock;
+ IpmiInterfaceMock ipmiMock;
+}
+
+} // namespace ipmiblob