summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_decl.sh54
1 files changed, 46 insertions, 8 deletions
diff --git a/tests/test_decl.sh b/tests/test_decl.sh
index 706ffdd..c317f50 100755
--- a/tests/test_decl.sh
+++ b/tests/test_decl.sh
@@ -4,21 +4,58 @@ ret=0
4check(){ 4check(){
5 i=$1 5 i=$1
6 shift 6 shift
7 sed -n "/^$i(/{g;1!p;};h" $@ >eapi.decl 7 grep -h -B1 -10 -e "^$i(" $@ >eapi.decl
8 lines=$(wc -l eapi.decl|cut -f1 -d' ') 8 if [ $? != 0 ]; then
9 if [ $lines == 0 ]; then
10 echo -e "\e[31;1mNOT IMPLEMENTED\e[m\t $i" 9 echo -e "\e[31;1mNOT IMPLEMENTED\e[m\t $i"
11 ret=1 10 ret=1
12 elif [ $lines != 1 ]; then 11 return
13 echo -e "\e[31;1mMULTI IMPLEMENTED\e[m\t $i" 12 fi
13 grep -qe "^--$" eapi.decl
14 if [ $? == 0 ]; then
15 echo -e "\e[31;1mMULTI IMPLEMENT\e[m\t $i"
14 ret=1 16 ret=1
15 else 17 return
16 cat eapi.decl | grep -qe '^EAPI' 18 fi
19
20 head -1 eapi.decl | grep -qe '^EAPI'
21 if [ $? != 0 ];then
22 echo -e "\e[31;1mMISSING EAPI\e[m\t $i"
23 ret=1
24 fi
25
26 func=$(echo $i | grep -oe 'elm_\w\+')
27
28 sed '2q;d' eapi.decl | grep -qe "elm_widget\w\+(\(const \)\?Evas_Object \*"
29 if [ $? == 0 ];then
30 tail -n9 eapi.decl | grep -q "\(API_ENTRY\|_elm_widget_is\)"
17 if [ $? != 0 ];then 31 if [ $? != 0 ];then
18 echo -e "\e[31;1mMISSING EAPI\e[m\t $i" 32 echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
19 ret=1 33 ret=1
20 fi 34 fi
35 return
36 fi
37
38 sed '2q;d' eapi.decl | grep -qe "elm_object_\w\+("
39 if [ $? == 0 ];then
40 rm eapi.decl
41 return
21 fi 42 fi
43
44 sed '2q;d' eapi.decl | grep -qe "elm_\w\+_add("
45 if [ $? == 0 ];then
46 rm eapi.decl
47 return
48 fi
49
50 sed '2q;d' eapi.decl | grep -qe "elm_\w\+(\(const \)\?Evas_Object \*"
51 if [ $? == 0 ];then
52 tail -n9 eapi.decl | grep -q "ELM_CHECK_WIDTYPE"
53 if [ $? != 0 ];then
54 echo -e "\e[31;1mMISSING CHECKER\e[m\t $i"
55 ret=1
56 fi
57 fi
58
22 rm eapi.decl 59 rm eapi.decl
23} 60}
24 61
@@ -40,5 +77,6 @@ for i in $(cat eapi.list); do
40 check $i src/lib/elm_widget.c 77 check $i src/lib/elm_widget.c
41done 78done
42 79
80rm -f eapi.decl
43rm eapi.list 81rm eapi.list
44exit $ret 82exit $ret