forked from enlightenment/efl
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:
parent
a88ec9a405
commit
ab3daf33ae
|
@ -112,7 +112,8 @@ test_web.c \
|
||||||
test_win_inline.c \
|
test_win_inline.c \
|
||||||
test_win_socket.c \
|
test_win_socket.c \
|
||||||
test_win_plug.c \
|
test_win_plug.c \
|
||||||
test_win_state.c
|
test_win_state.c \
|
||||||
|
test.h
|
||||||
|
|
||||||
if HAVE_EIO
|
if HAVE_EIO
|
||||||
elementary_test_SOURCES += test_eio.c
|
elementary_test_SOURCES += test_eio.c
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
|
#include "test.h"
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "elementary_config.h"
|
# include "elementary_config.h"
|
||||||
#endif
|
#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);
|
*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__)
|
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() */
|
elm_exit(); /* exit the program's main loop that runs in elm_run() */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue