aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-28 23:51:20 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-29 09:47:06 -0400
commit3f4d7e175cf81256848de05cd6df55f29fe05ae0 (patch)
tree0d5abc93bddcc069e22cf9b26d63f32cf86e52fc
parenttweak ops start time (diff)
downloadefl-devs/discomfitor/ci-make-check.tar.gz
-rw-r--r--src/lib/eio/eio_monitor.c5
-rw-r--r--src/lib/eio/eio_monitor_inotify.c22
-rw-r--r--src/tests/efl_check.h2
-rw-r--r--src/tests/eio/eio_suite.c1
-rw-r--r--src/tests/eio/eio_test_monitor.c39
5 files changed, 26 insertions, 43 deletions
diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c
index 84262bb329..21704bfc82 100644
--- a/src/lib/eio/eio_monitor.c
+++ b/src/lib/eio/eio_monitor.c
@@ -150,6 +150,7 @@ eio_monitor_init(void)
EIO_MONITOR_DIRECTORY_DELETED = ecore_event_type_new();
EIO_MONITOR_DIRECTORY_MODIFIED = ecore_event_type_new();
EIO_MONITOR_DIRECTORY_CLOSED = ecore_event_type_new();
+ fprintf(stderr, "EIO_MONITOR_ERROR = %d\n", EIO_MONITOR_ERROR);
eio_monitor_backend_init();
eio_monitor_fallback_init();
@@ -218,10 +219,10 @@ void
_eio_monitor_send(Eio_Monitor *monitor, const char *filename, int event_code)
{
Eio_Monitor_Event *ev;
-
+fprintf(stderr, "%s:%u EVENT %d\n", __FILE__, __LINE__, event_code);
if (monitor->delete_me)
return;
-
+fprintf(stderr, "%s:%u EVENT %d\n", __FILE__, __LINE__, event_code);
INF("Event '%s' for monitored path '%s'.",
_eio_naming_event(event_code), filename);
diff --git a/src/lib/eio/eio_monitor_inotify.c b/src/lib/eio/eio_monitor_inotify.c
index f3a83be5b7..a9cca1f7f7 100644
--- a/src/lib/eio/eio_monitor_inotify.c
+++ b/src/lib/eio/eio_monitor_inotify.c
@@ -91,10 +91,10 @@ _eio_inotify_events(Eio_Monitor_Backend *backend, const char *file, int mask)
unsigned int tmp_length;
unsigned int i;
Eina_Bool is_dir;
-
+fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
if (backend->parent->delete_me)
return;
-
+fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
length = file ? strlen(file) : 0;
tmp_length = eina_stringshare_strlen(backend->parent->path) + length + 2;
tmp = alloca(sizeof (char) * tmp_length);
@@ -106,16 +106,16 @@ _eio_inotify_events(Eio_Monitor_Backend *backend, const char *file, int mask)
is_dir = !!(mask & IN_ISDIR);
-
+fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
for (i = 0; i < sizeof (match) / sizeof (Eio_Inotify_Table); ++i)
if (match[i].mask & mask)
- {
+ {fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
_eio_monitor_send(backend->parent, tmp, is_dir ? *match[i].ev_dir_code : *match[i].ev_file_code);
}
/* special case for IN_IGNORED */
if (mask & IN_IGNORED)
- {
+ {fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
_eio_monitor_rename(backend->parent, tmp);
}
}
@@ -143,9 +143,10 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
// No need to waste time looking up for just destroyed handler
if ((event->mask & IN_IGNORED)) continue ;
-
+fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
backend = eina_hash_find(_inotify_monitors, &event->wd);
if (!backend) continue ;
+ fprintf(stderr, "%s:%u\n", __FILE__, __LINE__);
if (!backend->parent) continue ;
_eio_inotify_events(backend, (event->len ? event->name : NULL), event->mask);
@@ -196,11 +197,17 @@ void eio_monitor_backend_init(void)
if (fd < 0)
return;
- eina_file_close_on_exec(fd, EINA_TRUE);
+ if (!eina_file_close_on_exec(fd, EINA_TRUE))
+ {
+ ERR("CLOEXEC failed!");
+ close(fd);
+ return;
+ }
_inotify_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _eio_inotify_handler, NULL, NULL, NULL);
if (!_inotify_fdh)
{
+ ERR("FDH creation failed!");
close(fd);
return;
}
@@ -262,6 +269,7 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
backend->hwnd = inotify_add_watch(ecore_main_fd_handler_fd_get(_inotify_fdh), monitor->path, mask);
if (backend->hwnd < 0)
{
+ ERR("ERROR adding inotify watch: %s", strerror(errno));
if (errno != EACCES)
eio_monitor_fallback_add(monitor);
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h
index 0e655541ab..3417a381cc 100644
--- a/src/tests/efl_check.h
+++ b/src/tests/efl_check.h
@@ -266,7 +266,7 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
sr = srunner_create(s);
do_fork = _efl_test_fork_has(sr);
if (do_fork)
- can_fork = !!etc[1].test_case /* can't parallelize 1 test */;
+ can_fork = strcmp(suite_name, "Eio") && !!etc[1].test_case /* can't parallelize 1 test */;
for (i = 0; etc[i].test_case; ++i)
{
diff --git a/src/tests/eio/eio_suite.c b/src/tests/eio/eio_suite.c
index 5b59c5c4dc..1f0d417e68 100644
--- a/src/tests/eio/eio_suite.c
+++ b/src/tests/eio/eio_suite.c
@@ -37,6 +37,7 @@ static const Efl_Test_Case etc[] = {
SUITE_INIT(eio)
{
ck_assert_int_eq(eio_init(), 1);
+eina_log_level_set(4);
}
SUITE_SHUTDOWN(eio)
diff --git a/src/tests/eio/eio_test_monitor.c b/src/tests/eio/eio_test_monitor.c
index 26b469fe96..f8eaf8d838 100644
--- a/src/tests/eio/eio_test_monitor.c
+++ b/src/tests/eio/eio_test_monitor.c
@@ -14,8 +14,8 @@
/////////////////timeout function
-#define TEST_TIMEOUT_SEC 5
-#define TEST_OPERATION_DELAY 1
+#define TEST_TIMEOUT_SEC 0.5
+#define TEST_OPERATION_DELAY 0.05
static Ecore_Timer *test_timeout_timer;
@@ -485,7 +485,7 @@ static void _directory_self_deleted_cb(void *data, int type, void *event)
EFL_START_TEST(eio_test_monitor_directory_directory_self_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
-
+fprintf(stderr, "START TEST eio_test_monitor_directory_directory_self_deleted_notify\n");
//monitor directory
eio_monitor_add(dirname);
ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, (Ecore_Event_Handler_Cb)_directory_self_deleted_cb, dirname);
@@ -504,7 +504,7 @@ EFL_START_TEST(eio_test_monitor_file_file_modified_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
-
+fprintf(stderr, "START TEST eio_test_monitor_file_file_modified_notify\n");
filename = eina_stringshare_printf("%s/filecreated", dirname);
_create_file((void*)filename);
@@ -571,7 +571,7 @@ EFL_START_TEST(eio_test_monitor_file_file_self_deleted_notify)
{
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
-
+fprintf(stderr, "START TEST eio_test_monitor_file_file_self_deleted_notify\n");
filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_self_deleted_notify", dirname);
_create_file((void*)filename);
@@ -677,7 +677,7 @@ EFL_START_TEST(eio_test_monitor_two_files_in_same_directory)
Eina_Tmpstr *dirname = _common_init();
Eina_Stringshare *filename;
Eina_Stringshare *filename2;
-
+fprintf(stderr, "START TEST eio_test_monitor_two_files_in_same_directory\n");
filename = eina_stringshare_printf("%s/eio_test_monitor_two_files_in_same_directory_1", dirname);
filename2 = eina_stringshare_printf("%s/eio_test_monitor_two_files_in_same_directory_2", dirname);
_create_file((void*)filename);
@@ -730,36 +730,9 @@ EFL_END_TEST
void eio_test_monitor(TCase *tc)
{
- tcase_add_test(tc, eio_test_monitor_add_and_remove);
- tcase_add_test(tc, eio_test_monitor_add_remove_add);
- tcase_add_test(tc, eio_test_monitor_add_add_remove_remove);
-
- tcase_add_test(tc, eio_test_monitor_directory_file_created_notify);
- tcase_add_test(tc, eio_test_monitor_directory_multi_file_created_notify);
- tcase_add_test(tc, eio_test_monitor_directory_file_deleted_notify);
- tcase_add_test(tc, eio_test_monitor_directory_file_modified_notify);
-#if !defined(_WIN32) && !defined(__MACH__)
- tcase_add_test(tc, eio_test_monitor_directory_file_closed_notify);
-#endif
- tcase_add_test(tc, eio_test_monitor_directory_directory_created_notify);
- tcase_add_test(tc, eio_test_monitor_directory_directory_deleted_notify);
- tcase_add_test(tc, eio_test_monitor_directory_directory_modified_notify);
-#ifndef __MACH__
tcase_add_test(tc, eio_test_monitor_directory_directory_self_deleted_notify);
-#endif
tcase_add_test(tc, eio_test_monitor_file_file_modified_notify);
- tcase_add_test(tc, eio_test_monitor_file_file_attrib_modified_notify);
-#if !defined(_WIN32) && !defined(__MACH__)
- tcase_add_test(tc, eio_test_monitor_file_file_closed_notify);
-#endif
-#ifndef __MACH__
tcase_add_test(tc, eio_test_monitor_file_file_self_deleted_notify);
-#endif
-
- tcase_add_test(tc, eio_test_monitor_two_monitors_one_event);
- tcase_add_test(tc, eio_test_monitor_two_monitors_one_removed_one_event);
- tcase_add_test(tc, eio_test_monitor_two_monitors_one_removed_no_event);
tcase_add_test(tc, eio_test_monitor_two_files_in_same_directory);
- tcase_add_test(tc, eio_test_monitor_two_files_in_same_directory_one_removed);
}