summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-26 18:22:11 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-06-28 18:08:45 +0200
commit8a2a1c6488347ae26a28bac012c30b87f9b7d101 (patch)
treeab2ef880a49c65ac9b6056e51b046e001d3ff0c3 /src/tests/eio
parent7ed4b407e7eea8edd8014a13ffd451babb38e40e (diff)
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
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_test_monitor.c28
-rw-r--r--src/tests/eio/eio_test_sentry.c24
2 files changed, 38 insertions, 14 deletions
diff --git a/src/tests/eio/eio_test_monitor.c b/src/tests/eio/eio_test_monitor.c
index 19e0a2404a..c1eb002b89 100644
--- a/src/tests/eio/eio_test_monitor.c
+++ b/src/tests/eio/eio_test_monitor.c
@@ -359,16 +359,22 @@ EFL_START_TEST(eio_test_monitor_directory_file_closed_notify)
359{ 359{
360 Eina_Tmpstr *dirname = _common_init(); 360 Eina_Tmpstr *dirname = _common_init();
361 Eina_Stringshare *filename; 361 Eina_Stringshare *filename;
362 Eio_Monitor *monitor;
362 363
363 filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_closed_notify", dirname); 364 filename = eina_stringshare_printf("%s/eio_test_monitor_directory_file_closed_notify", dirname);
364 _create_file((void*)filename); 365 _create_file((void*)filename);
365 366
366 //monitor directory 367 //monitor directory
367 eio_monitor_add(dirname); 368 monitor = eio_monitor_add(dirname);
368 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename); 369 if (eio_monitor_fallback_check(monitor))
369 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 370 printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_directory_file_closed_notify");
371 else
372 {
373 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
374 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
370 375
371 ecore_main_loop_begin(); 376 ecore_main_loop_begin();
377 }
372 378
373 _common_shutdown(dirname); 379 _common_shutdown(dirname);
374} 380}
@@ -540,16 +546,22 @@ EFL_START_TEST(eio_test_monitor_file_file_closed_notify)
540{ 546{
541 Eina_Tmpstr *dirname = _common_init(); 547 Eina_Tmpstr *dirname = _common_init();
542 Eina_Stringshare *filename; 548 Eina_Stringshare *filename;
549 Eio_Monitor *monitor;
543 550
544 filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_closed_notify", dirname); 551 filename = eina_stringshare_printf("%s/eio_test_monitor_file_file_closed_notify", dirname);
545 _create_file((void*)filename); 552 _create_file((void*)filename);
546 553
547 //monitor file 554 //monitor file
548 eio_monitor_add(dirname); 555 monitor = eio_monitor_add(dirname);
549 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename); 556 if (eio_monitor_fallback_check(monitor))
550 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 557 printf("skipping %s: using fallback monitoring\n", "eio_test_monitor_file_file_closed_notify");
558 else
559 {
560 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, (Ecore_Event_Handler_Cb)_file_closed_cb, filename);
561 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
551 562
552 ecore_main_loop_begin(); 563 ecore_main_loop_begin();
564 }
553 565
554 _common_shutdown(dirname); 566 _common_shutdown(dirname);
555} 567}
diff --git a/src/tests/eio/eio_test_sentry.c b/src/tests/eio/eio_test_sentry.c
index 349743652c..d4e687ec73 100644
--- a/src/tests/eio/eio_test_sentry.c
+++ b/src/tests/eio/eio_test_sentry.c
@@ -2,6 +2,8 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#define EIO_SENTRY_BETA
6
5#include <stdio.h> 7#include <stdio.h>
6#include <unistd.h> 8#include <unistd.h>
7#include <string.h> 9#include <string.h>
@@ -297,10 +299,15 @@ EFL_START_TEST(eio_test_sentry_directory_file_closed_notify)
297 299
298 //monitor directory 300 //monitor directory
299 fail_if(!eio_sentry_add(sentry, dirname)); 301 fail_if(!eio_sentry_add(sentry, dirname));
300 efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename); 302 if (eio_sentry_fallback_check(sentry, dirname))
301 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 303 printf("skipping %s: using fallback monitoring\n", "eio_test_sentry_directory_file_closed_notify");
304 else
305 {
306 efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
307 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
302 308
303 ecore_main_loop_begin(); 309 ecore_main_loop_begin();
310 }
304 311
305 efl_unref(sentry); 312 efl_unref(sentry);
306 313
@@ -462,10 +469,15 @@ EFL_START_TEST(eio_test_sentry_file_file_closed_notify)
462 469
463 //monitor file 470 //monitor file
464 fail_if(!eio_sentry_add(sentry, dirname)); 471 fail_if(!eio_sentry_add(sentry, dirname));
465 efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename); 472 if (eio_sentry_fallback_check(sentry, dirname))
466 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename); 473 printf("skipping %s: using fallback monitoring\n", "eio_test_sentry_file_file_closed_notify");
474 else
475 {
476 efl_event_callback_add(sentry, EIO_SENTRY_EVENT_FILE_CLOSED, (Efl_Event_Cb)_target_notified_cb, filename);
477 ecore_timer_add(TEST_OPERATION_DELAY, _modify_file, filename);
467 478
468 ecore_main_loop_begin(); 479 ecore_main_loop_begin();
480 }
469 481
470 efl_unref(sentry); 482 efl_unref(sentry);
471 483