blob: 87614cb90e9cb5c77a0bd6aadf8f652603845754 [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
19 using namespace example::xyz::openbmc_project::Example::Elog;
20 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}