test: add callout-test
Add test program which can create callouts based on an input device
path. It creates an error, with callouts, with name TestCallout.
Change-Id: I96b66b73ae4a9c00daff06222841a13747c07408
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/callouts/callout_test.cpp b/callouts/callout_test.cpp
new file mode 100644
index 0000000..2af6dc0
--- /dev/null
+++ b/callouts/callout_test.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/elog-errors.hpp>
+#include "elog_meta.hpp"
+
+using namespace phosphor::logging;
+
+int main(int argc, char** argv)
+{
+ if(2 != argc)
+ {
+ std::cerr << "usage: callout-test <sysfs path>" << std::endl;
+ return -1;
+ }
+
+ using namespace example::xyz::openbmc_project::Example::Elog;
+ try
+ {
+ elog<TestCallout>(
+ TestCallout::DEV_ADDR(0xDEADEAD),
+ TestCallout::CALLOUT_ERRNO_TEST(0),
+ TestCallout::CALLOUT_DEVICE_PATH_TEST(argv[1]));
+ }
+ catch (elogException<TestCallout>& e)
+ {
+ commit(e.name());
+ }
+
+ return 0;
+}
+
+