summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-13 11:50:34 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-17 15:19:46 +0000
commit02bdbe7a11c4a6a85a0f742ffcf83d95e729921f (patch)
tree1392a8405048f4c97635321aa508b30ff4924233 /test
parentb666e539af3e70bf73f3aa459e54190c71c878f0 (diff)
downloadphosphor-inventory-manager-02bdbe7a11c4a6a85a0f742ffcf83d95e729921f.tar.gz
phosphor-inventory-manager-02bdbe7a11c4a6a85a0f742ffcf83d95e729921f.zip
types: Add build testcase
Add a basic compile time test that ensures types.hpp can build on its own. Change-Id: Idbf8a68feb1bf30b4fb573d254edf3a2f0a6f0cc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am6
-rw-r--r--test/types_test.cpp38
2 files changed, 44 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index eb95144..ce83bac 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -9,6 +9,12 @@ noinst_LTLIBRARIES = libtest.la
TESTS = ${check_PROGRAMS}
+types_test_SOURCES = types_test.cpp
+types_test_CFLAGS = ${GTEST_CFLAGS} ${GMOCK_CFLAGS}
+types_test_LDADD = ${GTEST_LIBS} ${GMOCK_LIBS}
+types_test_LDFLAGS = ${OESDK_TESTCASE_FLAGS}
+check_PROGRAMS += types-test
+
extra_yamldir=$(top_srcdir)/example/extra_interfaces.d
phosphor_inventory_test_SOURCES = test.cpp
diff --git a/test/types_test.cpp b/test/types_test.cpp
new file mode 100644
index 0000000..04e13d5
--- /dev/null
+++ b/test/types_test.cpp
@@ -0,0 +1,38 @@
+#include "../types.hpp"
+
+/**
+ * No runtime tests - just make sure we have the right headers included.
+ */
+using namespace phosphor::inventory::manager;
+
+struct Empty
+{
+};
+
+void functionUsingInterfaceVariantType(InterfaceVariantType&)
+{
+}
+void functionUsingInterfaceType(InterfaceType<Empty>&)
+{
+}
+void functionUsingObjectType(ObjectType<Empty>&)
+{
+}
+void functionUsingInterface(Interface&)
+{
+}
+void functionUsingObject(Object&)
+{
+}
+void functionUsingAction(Action&)
+{
+}
+void functionUsingFilter(Filter&)
+{
+}
+void functionUsingPathCondition(PathCondition&)
+{
+}
+void functionUsingGetProperty(GetProperty<Empty>&)
+{
+}
OpenPOWER on IntegriCloud