diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/.gitignore | 1 | ||||
-rw-r--r-- | src/test/Makefile.am | 12 | ||||
-rw-r--r-- | src/test/callbacktest.cpp | 15 |
3 files changed, 28 insertions, 0 deletions
diff --git a/src/test/.gitignore b/src/test/.gitignore index 9c938e1..c286eac 100644 --- a/src/test/.gitignore +++ b/src/test/.gitignore @@ -13,3 +13,4 @@ /callbackgroupgentest /conditiongentest.hpp /conditiongentest +/callbacktest diff --git a/src/test/Makefile.am b/src/test/Makefile.am index aaae1ff..a5d7405 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -179,3 +179,15 @@ conditiongentest.hpp: $(CONDITION_TEST_GEN_DEPS) -d ${srcdir}/yaml/conditiongentest \ -o $(builddir)/$@ \ generate-cpp + +check_PROGRAMS += callbacktest +callbacktest_SOURCES = \ + callbacktest.cpp +callbacktest_CXXFLAGS = \ + $(gtest_cflags) +callbacktest_LDFLAGS = \ + $(OESDK_TESTCASE_FLAGS) +callbacktest_LDADD = \ + ${gtest_ldadd} \ + ${SDBUSPLUS_LIBS} \ + $(builddir)/../journal.o diff --git a/src/test/callbacktest.cpp b/src/test/callbacktest.cpp new file mode 100644 index 0000000..1152e12 --- /dev/null +++ b/src/test/callbacktest.cpp @@ -0,0 +1,15 @@ +#include <gtest/gtest.h> + +#include "generated.hpp" + +using namespace phosphor::dbus::monitoring; + +TEST(JournalTest, Test) +{ + // No assertions here, but the least we can do + // make sure the program runs without crashing... + for (auto& c : ConfigPropertyCallbacks::get()) + { + (*c)(); + } +} |