X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_action.cpp;h=ad323e9acc169592c68de995f4344fe6d6e0e997;hp=7d0727eda237894bb3fa2b66e9b035548b179258;hb=HEAD;hpb=b17ed2ad7083d1b0bf45fe3e1bfc4e4ad787aaf3 diff --git a/tests/unit/test_action.cpp b/tests/unit/test_action.cpp index 7d0727eda..52f6d26ca 100644 --- a/tests/unit/test_action.cpp +++ b/tests/unit/test_action.cpp @@ -9,6 +9,7 @@ * */ +#include #include #include @@ -541,7 +542,7 @@ static void test_action_snapshot_session() lttng_payload_reset(&payload); } -int main() +static int _main() { plan_tests(NUM_TESTS); test_action_notify(); @@ -552,3 +553,13 @@ int main() test_action_snapshot_session(); return exit_status(); } + +int main() +{ + try { + return _main(); + } catch (const std::exception& e) { + ERR_FMT("Unhandled exception caught by action unit test: {}", e.what()); + abort(); + } +}