Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 1 | #include "elog_meta.hpp" |
| 2 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 3 | #include <phosphor-logging/elog-errors.hpp> |
| 4 | #include <phosphor-logging/elog.hpp> |
| 5 | #include <sdbusplus/exception.hpp> |
| 6 | |
Patrick Williams | 2544b41 | 2022-10-04 08:41:06 -0500 | [diff] [blame] | 7 | #include <iostream> |
| 8 | |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 9 | using namespace phosphor::logging; |
| 10 | |
| 11 | int main(int argc, char** argv) |
| 12 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 13 | if (2 != argc) |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 14 | { |
| 15 | std::cerr << "usage: callout-test <sysfs path>" << std::endl; |
| 16 | return -1; |
| 17 | } |
| 18 | |
Willy Tu | 6ddbf69 | 2023-09-05 10:54:16 -0700 | [diff] [blame] | 19 | using namespace example::xyz::openbmc_project::example::elog; |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 20 | try |
| 21 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 22 | elog<TestCallout>(TestCallout::DEV_ADDR(0xDEADEAD), |
| 23 | TestCallout::CALLOUT_ERRNO_TEST(0), |
| 24 | TestCallout::CALLOUT_DEVICE_PATH_TEST(argv[1])); |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 25 | } |
Patrick Williams | 66491c6 | 2021-10-06 12:23:37 -0500 | [diff] [blame] | 26 | catch (const TestCallout& e) |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 27 | { |
| 28 | commit(e.name()); |
| 29 | } |
| 30 | |
| 31 | return 0; |
| 32 | } |