On 04/18/2012 12:23 AM, Osier Yang wrote:
lib/*.py were destroyed. And there is no way to count the API
coverage now.
---
I tried to write a rough patch to generate the statistics, but
failed. There is no way to detect if the API is covered by the
cases, because the different class can have same methods name,
though I can filter out the APIs for each libvirt object by:
libvirt_module="/usr/lib64/python2.7/site-packages/libvirt.py"
declare -a arr=($(grep -E "class vir[A-Za-z]+:" $libvirt_module | \
cut -d' ' -f2))
for i in $(seq 0 $((${#arr[@]} - 1))); do
j=$(($i + 1))
echo "[ == ${arr[$i]} == ]"
if [ $j -lt ${#arr[@]} ]; then
sed -n -e "/${arr[$i]}/,/${arr[$j]}/{/${arr[$j]}/!p}" \
$libvirt_module | grep '^ def ' | grep -E -v "__del|__init"
| \
sed -e "s/\s*def //g" -e "s/(.*)://g"
fi
done
no hurry, let's do it later
ACK
Guannan Ren