aboutsummaryrefslogtreecommitdiffstats
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
parentecore: call eina_debug_fork_reset() in fork reset function (diff)
downloadefl-00bc3af4dd741e4b4575938893556965ce3aaf10.tar.gz
tests: add test for eina_debug signal handling
Summary: currently this crashes, so add a simple test to ensure that it works eventually ref https://phab.enlightenment.org/T7028 Reviewers: ManMower, devilhorns Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/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 \
tests/eina/eina_test_slice.c \
tests/eina/eina_test_freeq.c \
tests/eina/eina_test_slstr.c \
-tests/eina/eina_test_vpath.c
+tests/eina/eina_test_vpath.c \
+tests/eina/eina_test_debug.c
tests_eina_eina_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-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[] = {
{ "Util", eina_test_util },
{ "slstr", eina_test_slstr },
{ "Vpath", eina_test_vpath },
+ { "debug", eina_test_debug },
{ NULL, NULL }
};
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);
void eina_test_freeq(TCase *tc);
void eina_test_slstr(TCase *tc);
void eina_test_vpath(TCase *tc);
+void eina_test_debug(TCase *tc);
#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 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <Eina.h>
+
+#include "eina_suite.h"
+
+#ifndef _WIN32
+EFL_START_TEST(eina_test_debug_sighandler)
+{
+ /* ensure this doesn't crash */
+ raise(SIGPROF);
+}
+EFL_END_TEST
+#endif
+
+void
+eina_test_debug(TCase *tc)
+{
+#ifndef _WIN32
+ tcase_add_test_raise_signal(tc, eina_test_debug_sighandler, SIGPROF);
+#endif
+}