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

[tor-dev] Hi, all!



I'm about to go on vacation, but before I started, Isabela asked me
for coverage information on Tor, to help people decide where more
tests should be written.

I've re-run coverage, and uploaded the gcov output here:

https://people.torproject.org/~nickm/volatile/coverage-65a1e27.tar.bz2

That archive includes coverage on current master from
  * make check
  * make test-network (uses chutney)
  * make test-stem (uses stem)
  * all of the above, combined

I'm also attaching a script that I wrote long long ago, and use to
summarize coverage file-by-file. Example use:

gcov-lines.py ./coverage-65a1e27/cov-all/*


yrs,
-- 
Nick
#!/usr/bin/python
import sys, re

none0, some0 = 0,0
branchTaken0, branchNot0 = 0,0

BRANCH = False

if sys.argv[1] == '-b':
    BRANCH = True
    del sys.argv[1]

def show(name, none, some):
    print name, none, some, "%.02f"%(100*(float(some)/(some+none)))

for fn in sys.argv[1:]:
    none = some = branchTaken = branchNot = 0
    for line in open(fn, 'r'):
        if re.match(r'^ *###', line):
            none += 1
        elif re.match(r'^ *\d', line):
            some += 1
        else:
            m = re.match(r'^branch.*taken (\d+)%', line)
            if m:
                if int(m.group(1)) == 0:
                    branchNot += 1
                else:
                    branchTaken += 1

    none0 += none
    some0 += some
    branchTaken0 += branchTaken
    branchNot0 += branchNot
    if BRANCH:
        if branchTaken or branchNot:
            show(fn, branchNot, branchTaken)
    else:
        if some or none:
            show(fn, none, some)

if BRANCH:
    if branchTaken0 or branchNot0:
        show("TOTAL", branchNot0, branchTaken0)
else:
    if some0 or none0:
        show("TOTAL", none0, some0)
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev