diff options
-rw-r--r-- | test/Makefile.am | 9 | ||||
-rw-r--r-- | test/sdtest.cpp | 16 |
2 files changed, 24 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index e3468a3..7fd38d1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -8,7 +8,8 @@ check_PROGRAMS = \ serialization_test_properties \ remote_logging_test_address \ remote_logging_test_port \ - remote_logging_test_config + remote_logging_test_config \ + sdjournal_mock_test test_cppflags = \ -Igtest \ @@ -91,5 +92,11 @@ remote_logging_test_config_LDFLAGS = \ $(test_ldflags) \ -lstdc++fs +sdjournal_mock_test_CPPFLAGS = $(test_cppflags) +sdjournal_mock_test_CXXFLAGS = $(test_cxxflags) +sdjournal_mock_test_SOURCES = sdtest.cpp +sdjournal_mock_test_LDADD = $(top_builddir)/sdjournal.o +sdjournal_mock_test_LDFLAGS = $(test_ldflags) + # TODO Remove once the test-case failure is resolved openbmc/phosphor-logging#11 XFAIL_TESTS = elog_errorwrap_test diff --git a/test/sdtest.cpp b/test/sdtest.cpp new file mode 100644 index 0000000..82cf511 --- /dev/null +++ b/test/sdtest.cpp @@ -0,0 +1,16 @@ +#include <phosphor-logging/test/sdjournal_mock.hpp> + +namespace phosphor +{ +namespace logging +{ + +TEST(LoggingSwapTest, BasicTestToEnsureItCompiles) +{ + SdJournalMock mockInstance; + auto* old = SwapJouralHandler(&mockInstance); + SwapJouralHandler(old); +} + +} // namespace logging +} // namespace phosphor |