projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wrap main functions to handle uncaught exceptions
[lttng-tools.git]
/
tests
/
unit
/
test_action.cpp
diff --git
a/tests/unit/test_action.cpp
b/tests/unit/test_action.cpp
index 7d0727eda237894bb3fa2b66e9b035548b179258..c46b8fcea665fa177dbaa27c8b85a7027bec5096 100644
(file)
--- a/
tests/unit/test_action.cpp
+++ b/
tests/unit/test_action.cpp
@@
-9,6
+9,7
@@
*
*/
*
*/
+#include <common/error.hpp>
#include <common/payload-view.hpp>
#include <common/payload.hpp>
#include <common/payload-view.hpp>
#include <common/payload.hpp>
@@
-541,7
+542,7
@@
static void test_action_snapshot_session()
lttng_payload_reset(&payload);
}
lttng_payload_reset(&payload);
}
-
int
main()
+
static int _
main()
{
plan_tests(NUM_TESTS);
test_action_notify();
{
plan_tests(NUM_TESTS);
test_action_notify();
@@
-552,3
+553,13
@@
int main()
test_action_snapshot_session();
return exit_status();
}
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();
+ }
+}
This page took
0.028142 seconds
and
4
git commands to generate.