]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/coverage.py
Markup documentation: when a command is a copy of another markup
[lilypond.git] / buildscripts / coverage.py
1 #!/bin/sh
2 import os
3 import glob
4 import re
5
6 os.chdir ('out-cov')
7
8 #File 'accidental-engraver.cc'
9 #Lines executed:87.70% of 252
10
11 results = []
12 for f in glob.glob ('*.gcov-summary'):
13     str = open (f).read ()
14     m = re.search ("File '([^']+.cc)'\s*Lines executed:([0-9.]+)% of ([0-9]+)", str)
15
16     if m and '/usr/lib' in m.group (1):
17         continue
18    
19     if m:
20         cov = float (m.group (2))
21         lines = int (m.group (3))
22         pain = lines * (100.0 - cov)
23         file = m.group (1)
24         tup = (pain, locals ().copy())
25         
26         results.append(tup)
27
28 results.sort ()
29 results.reverse()
30 for (pain, d) in results:
31     print '%(cov)5.2f (%(lines)6d): %(file)s' % d
32