summaryrefslogtreecommitdiff
path: root/tests/test_setter.sh
diff options
context:
space:
mode:
authorTiago Rezende Campos Falcao <developer@tiagofalcao.com>2010-10-27 14:38:40 +0000
committerTiago Rezende Campos Falcao <developer@tiagofalcao.com>2010-10-27 14:38:40 +0000
commit8687aedc100389012b816673a64053d7ff6eb364 (patch)
treeb2bf896cebb20368854e8020d681ad4469971326 /tests/test_setter.sh
parent9875a4045afbe302fcedabc0fb988b9d61b58218 (diff)
Checkers for API consistence
SVN revision: 53918
Diffstat (limited to '')
-rwxr-xr-xtests/test_setter.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/test_setter.sh b/tests/test_setter.sh
new file mode 100755
index 000000000..25272645a
--- /dev/null
+++ b/tests/test_setter.sh
@@ -0,0 +1,49 @@
1#!/bin/bash
2ret=0
3
4check(){
5 func=$(echo $1 | grep -oe 'elm_\w\+')
6 base=${func%_set}
7 echo $1 | grep -qe "_set(const \+[^\(char \+\*\)]"
8 if [ $? == 0 ];then
9 echo -e "\e[31;1mCONST\e[m\t $func"
10 ret=1
11 fi
12 echo $1 | grep -qe "EAPI \+\(void\|Eina_Bool\)"
13 if [ $? != 0 ];then
14 echo -e "\e[31;1mUNKNOWN RETURN\e[m\t $func"
15 ret=1
16 fi
17 echo $1 | grep -qe "\(cb_set\|all_set\)("
18 if [ $? != 0 ];then
19 grep -qe "EAPI.*\<${base}_get\>" $2
20 if [ $? != 0 ];then
21 echo -e "\e[31;1mMISSING GETTER\e[m\t $func"
22 ret=1
23 fi
24 echo $1 | grep -qe "\(content\|icon\|end\)_set(\w\+ \+\*obj, \w\+ \+\*\w\+);"
25 if [ $? == 0 ];then
26 grep -qe "EAPI.*\<${base}_unset\>" $2
27 if [ $? != 0 ];then
28 echo -e "\e[31;1mMISSING UNSETTER\e[m\t $func"
29 ret=1
30 fi
31 fi
32 fi
33}
34
35HEADERS="src/lib/Elementary.h.in
36src/lib/Elementary_Cursor.h
37src/lib/elm_widget.h"
38
39IFS=$'\n'
40
41for header in $HEADERS; do
42 grep -e "^ *EAPI.*(.*)" $header | grep -e 'elm_\w\+_set' >eapi.list
43
44 for i in $(cat eapi.list); do
45 check $i $header
46 done
47 rm eapi.list
48done
49exit $ret