summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-05-06 09:42:21 -0700
committerPatrick Venture <venture@google.com>2019-05-06 09:46:18 -0700
commit972547697e45b813891712b6c11111889a0a32d0 (patch)
tree0f10acc3d8854c188aa640ee30b8f207b7337cdf
parent06561460bded9bf42398d987ac87bcec170740aa (diff)
downloadipmi-blob-tool-972547697e45b813891712b6c11111889a0a32d0.tar.gz
ipmi-blob-tool-972547697e45b813891712b6c11111889a0a32d0.zip
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>
-rw-r--r--test/Makefile.am5
-rw-r--r--test/build_mocks.cpp17
2 files changed, 22 insertions, 0 deletions
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_SOURCES = crc_unittest.cpp
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
OpenPOWER on IntegriCloud