Add test and checker to widget items

SVN revision: 54089
This commit is contained in:
Tiago Rezende Campos Falcao 2010-11-02 11:26:44 +00:00
parent 40a163685a
commit af5625cca4
2 changed files with 50 additions and 22 deletions

View File

@ -471,6 +471,14 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
#define ELM_CHECK_WIDTYPE(obj, widtype) \
if (!elm_widget_type_check((obj), (widtype))) return
#define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, ...) \
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__;
#define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \
if (!elm_widget_type_check((it->base.widget), (widtype))) goto label;
/**
* The drag and drop API.

View File

@ -24,36 +24,62 @@ check(){
fi
func=$(echo $i | grep -oe 'elm_\w\+')
ass=$(sed '2q;d' eapi.decl)
sed '2q;d' eapi.decl | grep -qe "elm_widget\w\+(\(const \)\?Evas_Object \*"
echo $i | grep -qe "^elm_object"
if [ $? == 0 ];then
tail -n9 eapi.decl | grep -q "\(API_ENTRY\|_elm_widget_is\)"
if [ $? != 0 ];then
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
ret=1
rm eapi.decl
return
fi
echo $i | grep -qe "^elm_widget"
if [ $? == 0 ];then
echo $ass | grep -qe "elm_widget\w\+(\(const \)\?Evas_Object \*"
if [ $? == 0 ];then
tail -n9 eapi.decl | grep -q "\(API_ENTRY\|_elm_widget_is\)"
if [ $? != 0 ];then
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
ret=1
fi
return
fi
echo $ass | grep -qe "elm_widget\w\+(\(const \)\?Elm_ \*"
if [ $? == 0 ];then
tail -n9 eapi.decl | grep -qe "ELM_WIDGET_ITEM_CHECK"
if [ $? != 0 ];then
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
ret=1
fi
return
fi
return
fi
sed '2q;d' eapi.decl | grep -qe "elm_object_\w\+("
echo $ass | grep -qe "elm_\w\+_add"
if [ $? == 0 ];then
rm eapi.decl
echo -e "\e[32;1m???\e[m\t $i"
return
fi
sed '2q;d' eapi.decl | grep -qe "elm_\w\+_add("
if [ $? == 0 ];then
rm eapi.decl
return
fi
sed '2q;d' eapi.decl | grep -qe "elm_\w\+(\(const \)\?Evas_Object \*"
echo $ass | grep -qe "elm_\w\+(\(const \)\?Evas_Object \*"
if [ $? == 0 ];then
tail -n9 eapi.decl | grep -q "ELM_CHECK_WIDTYPE"
if [ $? != 0 ];then
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
ret=1
fi
return
fi
echo $ass | grep -qe "elm_\w\+(\(const \)\?Elm_\w\+_Item \*"
if [ $? == 0 ];then
tail -n9 eapi.decl | grep -qe "ELM_\w\+_ITEM_.*CHECK"
if [ $? != 0 ];then
echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
ret=1
fi
return
fi
rm eapi.decl
@ -62,13 +88,7 @@ check(){
grep -e "^ *EAPI.*(.*)" src/lib/Elementary.h.in | grep -oe 'elm_\w\+' >eapi.list
for i in $(cat eapi.list); do
check $i $(ls -1 src/lib/*.c | grep -v elm_widget | grep -v els_cursor)
done
grep -e "^ *EAPI.*(.*)" src/lib/Elementary_Cursor.h | grep -oe 'elm_\w\+' >eapi.list
for i in $(cat eapi.list); do
check $i src/lib/els_cursor.c src/lib/elm_main.c
check $i $(ls -1 src/lib/*.c | grep -v elm_widget)
done
grep -e "^ *EAPI.*(.*)" src/lib/elm_widget.h | grep -oe '_\?elm_\w\+' >eapi.list