forked from enlightenment/efl
tests: check eio monitors for fallback monitoring
the corresponding tests cannot be run when using fallback monitoring, so be sure to skip them when fallback is detected to avoid erroneous failure reporting fix T7042 Differential Revision: https://phab.enlightenment.org/D6448
This commit is contained in:
parent
7ed4b407e7
commit
8a2a1c6488
|
@ -359,16 +359,22 @@ EFL_START_TEST(eio_test_monitor_directory_file_closed_notify)
|
|||
{
|
||||
Eina_Tmpstr *dirname = _common_init();
|
||||
Eina_Stringshare *filename;
|
||||
Eio_Monitor *monitor;
|
||||
|
||||
filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_closed_notify", dirname);
|
||||
_create_file((void*)filename);
|
||||
|
||||
//monitor directory
|
||||
eio_monitor_add(dirname);
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
monitor = eio_monitor_add(dirname);
|
||||
if (eio_monitor_fallback_check(monitor))
|
||||
printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_directory_file_closed_notify");
|
||||
else
|
||||
{
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
||||
_common_shutdown(dirname);
|
||||
}
|
||||
|
@ -540,16 +546,22 @@ EFL_START_TEST(eio_test_monitor_file_file_closed_notify)
|
|||
{
|
||||
Eina_Tmpstr *dirname = _common_init();
|
||||
Eina_Stringshare *filename;
|
||||
Eio_Monitor *monitor;
|
||||
|
||||
filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_closed_notify", dirname);
|
||||
_create_file((void*)filename);
|
||||
|
||||
//monitor file
|
||||
eio_monitor_add(dirname);
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
monitor = eio_monitor_add(dirname);
|
||||
if (eio_monitor_fallback_check(monitor))
|
||||
printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_file_file_closed_notify");
|
||||
else
|
||||
{
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
||||
_common_shutdown(dirname);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define EIO_SENTRY_BETA
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
@ -297,10 +299,15 @@ EFL_START_TEST(eio_test_sentry_directory_file_closed_notify)
|
|||
|
||||
//monitor directory
|
||||
fail_if(!eio_sentry_add(sentry, dirname));
|
||||
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
if (eio_sentry_fallback_check(sentry, dirname))
|
||||
printf("skipping %s: using fallback monitoring\n", "eio_test_sentry_directory_file_closed_notify");
|
||||
else
|
||||
{
|
||||
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
||||
efl_unref(sentry);
|
||||
|
||||
|
@ -462,10 +469,15 @@ EFL_START_TEST(eio_test_sentry_file_file_closed_notify)
|
|||
|
||||
//monitor file
|
||||
fail_if(!eio_sentry_add(sentry, dirname));
|
||||
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
if (eio_sentry_fallback_check(sentry, dirname))
|
||||
printf("skipping %s: using fallback monitoring\n", "eio_test_sentry_file_file_closed_notify");
|
||||
else
|
||||
{
|
||||
efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
|
||||
ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
|
||||
|
||||
ecore_main_loop_begin();
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
||||
efl_unref(sentry);
|
||||
|
||||
|
|
Loading…
Reference in New Issue