summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-19 14:04:40 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-19 14:04:40 -0400
commit00bc3af4dd741e4b4575938893556965ce3aaf10 (patch)
treea6dec2eafaf3f6e9ce955978bab5670cdc5d9a90
parent83124559ccffb242af3e29a597a7ffd6a640699b (diff)
tests: add test for eina_debug signal handling
Summary: currently this crashes, so add a simple test to ensure that it works eventually ref T7028 Reviewers: ManMower, devilhorns Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: T7028 Differential Revision: https://phab.enlightenment.org/D6311
-rw-r--r--src/Makefile_Eina.am3
-rw-r--r--src/tests/eina/eina_suite.c1
-rw-r--r--src/tests/eina/eina_suite.h1
-rw-r--r--src/tests/eina/eina_test_debug.c24
4 files changed, 28 insertions, 1 deletions
diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 69561512a5..997c5262dd 100644
--- a/src/Makefile_Eina.am
+++ b/src/Makefile_Eina.am
@@ -359,7 +359,8 @@ tests/eina/eina_test_safepointer.c \
359tests/eina/eina_test_slice.c \ 359tests/eina/eina_test_slice.c \
360tests/eina/eina_test_freeq.c \ 360tests/eina/eina_test_freeq.c \
361tests/eina/eina_test_slstr.c \ 361tests/eina/eina_test_slstr.c \
362tests/eina/eina_test_vpath.c 362tests/eina/eina_test_vpath.c \
363tests/eina/eina_test_debug.c
363 364
364tests_eina_eina_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 365tests_eina_eina_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
365-DTESTS_WD=\"`pwd`\" \ 366-DTESTS_WD=\"`pwd`\" \
diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c
index 99d8720f6d..dfa2bd1e5f 100644
--- a/src/tests/eina/eina_suite.c
+++ b/src/tests/eina/eina_suite.c
@@ -88,6 +88,7 @@ static const Efl_Test_Case etc[] = {
88 { "Util", eina_test_util }, 88 { "Util", eina_test_util },
89 { "slstr", eina_test_slstr }, 89 { "slstr", eina_test_slstr },
90 { "Vpath", eina_test_vpath }, 90 { "Vpath", eina_test_vpath },
91 { "debug", eina_test_debug },
91 { NULL, NULL } 92 { NULL, NULL }
92}; 93};
93 94
diff --git a/src/tests/eina/eina_suite.h b/src/tests/eina/eina_suite.h
index cd509952ab..5e7a1bf30f 100644
--- a/src/tests/eina/eina_suite.h
+++ b/src/tests/eina/eina_suite.h
@@ -76,5 +76,6 @@ void eina_test_slice(TCase *tc);
76void eina_test_freeq(TCase *tc); 76void eina_test_freeq(TCase *tc);
77void eina_test_slstr(TCase *tc); 77void eina_test_slstr(TCase *tc);
78void eina_test_vpath(TCase *tc); 78void eina_test_vpath(TCase *tc);
79void eina_test_debug(TCase *tc);
79 80
80#endif /* EINA_SUITE_H_ */ 81#endif /* EINA_SUITE_H_ */
diff --git a/src/tests/eina/eina_test_debug.c b/src/tests/eina/eina_test_debug.c
new file mode 100644
index 0000000000..cea3f9a1ed
--- /dev/null
+++ b/src/tests/eina/eina_test_debug.c
@@ -0,0 +1,24 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <Eina.h>
6
7#include "eina_suite.h"
8
9#ifndef _WIN32
10EFL_START_TEST(eina_test_debug_sighandler)
11{
12 /* ensure this doesn't crash */
13 raise(SIGPROF);
14}
15EFL_END_TEST
16#endif
17
18void
19eina_test_debug(TCase *tc)
20{
21#ifndef _WIN32
22 tcase_add_test_raise_signal(tc, eina_test_debug_sighandler, SIGPROF);
23#endif
24}