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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]