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 <iostream> |
| 4 | #include <phosphor-logging/elog-errors.hpp> |
| 5 | #include <phosphor-logging/elog.hpp> |
| 6 | #include <sdbusplus/exception.hpp> |
| 7 | |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 8 | using namespace phosphor::logging; |
| 9 | |
| 10 | int main(int argc, char** argv) |
| 11 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 12 | if (2 != argc) |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 13 | { |
| 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 Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 21 | elog<TestCallout>(TestCallout::DEV_ADDR(0xDEADEAD), |
| 22 | TestCallout::CALLOUT_ERRNO_TEST(0), |
| 23 | TestCallout::CALLOUT_DEVICE_PATH_TEST(argv[1])); |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 24 | } |
Patrick Williams | 66491c6 | 2021-10-06 12:23:37 -0500 | [diff] [blame] | 25 | catch (const TestCallout& e) |
Deepak Kodihalli | 739e925 | 2017-03-05 23:23:50 -0600 | [diff] [blame] | 26 | { |
| 27 | commit(e.name()); |
| 28 | } |
| 29 | |
| 30 | return 0; |
| 31 | } |