X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_action.cpp;h=c46b8fcea665fa177dbaa27c8b85a7027bec5096;hp=7d0727eda237894bb3fa2b66e9b035548b179258;hb=d5ed3e6f3a8b52d7f2a3e2277873e0f1914ba515;hpb=58561706ca99e043a4687a776dc781bdf7e78e07 diff --git a/tests/unit/test_action.cpp b/tests/unit/test_action.cpp index 7d0727eda..c46b8fcea 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: %s", e.what()); + abort(); + } +}