elementary: Added infra for API testing in elementary_test

Signed-off-by: Aharon Hillel <a.hillel@partner.samsung.com>

SVN revision: 68319
This commit is contained in:
Aharon Hillel 2012-02-23 13:57:56 +00:00 committed by Tom Hacohen
parent a88ec9a405
commit ab3daf33ae
3 changed files with 23 additions and 3 deletions

View File

@ -112,7 +112,8 @@ test_web.c \
test_win_inline.c \
test_win_socket.c \
test_win_plug.c \
test_win_state.c
test_win_state.c \
test.h
if HAVE_EIO
elementary_test_SOURCES += test_eio.c

View File

@ -1,4 +1,5 @@
#include <Elementary.h>
#include "test.h"
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
@ -198,10 +199,9 @@ elm_test_add(Eina_List **p_list, const char *icon, const char *category, const c
*p_list = eina_list_sorted_insert(*p_list, elm_test_sort, t);
}
static void
void
my_win_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
/* called when my_win_main is requested to be deleted */
elm_exit(); /* exit the program's main loop that runs in elm_run() */
}

View File

@ -0,0 +1,19 @@
#ifndef _TEST_H
#define _TEST_H
#define fail_if(expr) \
do { \
if ( expr ) \
{ \
FILE *fp; \
char buf[1024]; \
sprintf(buf, "fail_%s.txt", elm_win_title_get(win)); \
if ((fp = fopen(buf, "a")) != NULL) \
{ \
fprintf(fp, "Failed at %s:%d on <%s>\n", \
__FILE__, __LINE__, #expr); \
fclose(fp); \
} \
} \
} while(0)
#endif