blob: 90882431f9149ac8e649e5d2feeba9585d0519eb [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 <phosphor-logging/elog-errors.hpp>
4#include <phosphor-logging/elog.hpp>
5#include <sdbusplus/exception.hpp>
6
Patrick Williams2544b412022-10-04 08:41:06 -05007#include <iostream>
8
Deepak Kodihalli739e9252017-03-05 23:23:50 -06009using namespace phosphor::logging;
10
11int main(int argc, char** argv)
12{
Patrick Venturef18bf832018-10-26 18:14:00 -070013 if (2 != argc)
Deepak Kodihalli739e9252017-03-05 23:23:50 -060014 {
15 std::cerr << "usage: callout-test <sysfs path>" << std::endl;
16 return -1;
17 }
18
Willy Tu6ddbf692023-09-05 10:54:16 -070019 using namespace example::xyz::openbmc_project::example::elog;
Deepak Kodihalli739e9252017-03-05 23:23:50 -060020 try
21 {
Patrick Venturef18bf832018-10-26 18:14:00 -070022 elog<TestCallout>(TestCallout::DEV_ADDR(0xDEADEAD),
23 TestCallout::CALLOUT_ERRNO_TEST(0),
24 TestCallout::CALLOUT_DEVICE_PATH_TEST(argv[1]));
Deepak Kodihalli739e9252017-03-05 23:23:50 -060025 }
Patrick Williams66491c62021-10-06 12:23:37 -050026 catch (const TestCallout& e)
Deepak Kodihalli739e9252017-03-05 23:23:50 -060027 {
28 commit(e.name());
29 }
30
31 return 0;
32}