{ NULL, NULL }
};
+static Ecore_Timer *timeout;
+int timeout_reached = 0;
+
+static Eina_Bool
+timeout_cb()
+{
+ const char *tcname = tcase_name();
+
+ timeout_reached = 1;
+
+ if (tcname && strstr(tcname, "download"))
+ {
+ fprintf(stderr, "test timeout reached: download failed, probably network issue. skipping\n");
+ ecore_main_loop_quit();
+ }
+ else
+ ck_abort_msg("test timeout reached!");
+ timeout = NULL;
+ return EINA_FALSE;
+}
+
SUITE_INIT(ecore)
{
+ timeout_reached = 0;
ck_assert_int_eq(ecore_init(), 1);
+ timeout = ecore_timer_add(5.0, timeout_cb, NULL);
+ ck_assert_msg(!!timeout, "timeout timer creation failed!");
}
SUITE_SHUTDOWN(ecore)
{
+ ecore_timer_del(timeout);
+ timeout = NULL;
ck_assert_int_eq(ecore_shutdown(), 0);
}
#include <check.h>
#include "../efl_check.h"
+
+extern int timeout_reached;
+
void ecore_test_ecore(TCase *tc);
void ecore_test_ecore_idle(TCase *tc);
void ecore_test_ecore_poller(TCase *tc);
fail_if(!job);
ecore_file_download_abort(job);
ecore_main_loop_begin();
+ if (timeout_reached) goto end;
res = ecore_file_remove(dest_name);
fail_if(res != EINA_TRUE);
fail_if(res != EINA_TRUE);
fail_if(!job);
ecore_main_loop_begin();
+ if (timeout_reached) goto end;
fprintf(stderr, "Downloaded %lld bytes\n", ecore_file_size(dest_name));
res = ecore_file_exists(dest_name);
fail_if(res != EINA_TRUE);
-
+end:
res = ecore_file_recursive_rm(download_dir);
fail_if(res != EINA_TRUE);