diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2016-03-16 08:14:02 +0000 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2016-03-16 08:14:02 +0000 |
commit | 0f45924f4c5bfca7cfa98553c6e9f85499023c5f (patch) | |
tree | 819baca78d52e3ce524b706b763c763bfaf5a4b5 | |
parent | 53ee80bd7d1d98d87654c57098722532df55dd1b (diff) |
tests: exit on SIGABRT
Fatal error exit usually with abort() causing SIGABRT to be triggered
which can have problems with core dump generation depending on system
settings. Capturing and exiting on this signal solve the problem.
This is a workaround to some system configurations which could cause
test to fail.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
-rw-r--r-- | tests/test-logging.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test-logging.c b/tests/test-logging.c index 94e923a..eed149e 100644 --- a/tests/test-logging.c +++ b/tests/test-logging.c @@ -377,11 +377,19 @@ static void test_spice_g_messages_debug_all(void) g_test_trap_assert_stderr("*g_message\n*other_message\n"); } +static void handle_sigabrt(int sig) +{ + _Exit(1); +} int main(int argc, char **argv) { GLogLevelFlags fatal_mask; + /* prevents core generations as this could cause some issues/timeout + * depending on system configuration */ + signal(SIGABRT, handle_sigabrt); + fatal_mask = (GLogLevelFlags)g_log_set_always_fatal((GLogLevelFlags) G_LOG_FATAL_MASK); g_test_init(&argc, &argv, NULL); |