[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [test-API] Delete the script to generate the testing coverage statistics



On 2012年04月18日 15:13, Guannan Ren wrote:
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

No worry, it's in git history, we can get it back in case.


ACK

Guannan Ren


Pushed, thanks.

Osier


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]