blob: 729bbf5a63f93e2d2e0e62e03c8e4f9b8075ae84 [file] [log] [blame]
Deepak Kodihalli739e9252017-03-05 23:23:50 -06001#include "elog_meta.hpp"
2
Patrick Venturef18bf832018-10-26 18:14:00 -07003#include <iostream>
4#include <phosphor-logging/elog-errors.hpp>
5#include <phosphor-logging/elog.hpp>
6#include <sdbusplus/exception.hpp>
7
Deepak Kodihalli739e9252017-03-05 23:23:50 -06008using namespace phosphor::logging;
9
10int main(int argc, char** argv)
11{
Patrick Venturef18bf832018-10-26 18:14:00 -070012 if (2 != argc)
Deepak Kodihalli739e9252017-03-05 23:23:50 -060013 {
14 std::cerr << "usage: callout-test <sysfs path>" << std::endl;
15 return -1;
16 }
17
18 using namespace example::xyz::openbmc_project::Example::Elog;
19 try
20 {
Patrick Venturef18bf832018-10-26 18:14:00 -070021 elog<TestCallout>(TestCallout::DEV_ADDR(0xDEADEAD),
22 TestCallout::CALLOUT_ERRNO_TEST(0),
23 TestCallout::CALLOUT_DEVICE_PATH_TEST(argv[1]));
Deepak Kodihalli739e9252017-03-05 23:23:50 -060024 }
Deepak Kodihalli15331102017-03-09 23:50:43 -060025 catch (TestCallout& e)
Deepak Kodihalli739e9252017-03-05 23:23:50 -060026 {
27 commit(e.name());
28 }
29
30 return 0;
31}