touch scripts/out-cov/midi2ly.1
make conf=cov -j2 && \
make conf=cov test-clean OUT_TEST=testcov LILYPOND_JOBS= && \
- make conf=cov test OUT_TEST=testcov LILYPOND_JOBS=
+ make conf=cov test OUT_TEST=testcov LILYPOND_JOBS='-dtrace-scheme-coverage '
if test "$?" != "0"; then
tail -100 out-cov/test-run.log
cd $resultdir
ln $depth/lily/* .
+ln $depth/scm/*.scm .
+ln $depth/ly/*.ly .
ln $depth/lily/out-cov/*[ch] .
mkdir include
ln $depth/lily/include/* include/
python $depth/buildscripts/coverage.py --uncovered *.cc > uncovered.txt
python $depth/buildscripts/coverage.py --hotspots *.cc > hotspots.txt
python $depth/buildscripts/coverage.py --summary *.cc > summary.txt
+python $depth/buildscripts/coverage.py --uncovered *.scm > uncovered-scheme.txt
head -20 summary.txt
out/coverage-results/summary.txt
out/coverage-results/uncovered.txt
+ out/coverage-results/uncovered-scheme.txt
out/coverage-results/hotspots.txt
EOF
cov = ''
sys.stdout.write ('%8s:%8d:%s' % (cov, n, l))
+ def uncovered_score (self):
+ return length (self)
+
+class SchemeChunk (Chunk):
+ def uncovered_score (self):
+ text = self.text ()
+ if (text.startswith ('(define')
+ and not text.startswith ('(define (')):
+ return 0
+
+ return len ([l for (c,n,l) in self.lines() if (c == 0)])
+
def read_gcov (f):
ls = []
chunk = []
def new_chunk ():
- nums = [n-1 for (n, l) in chunk]
- chunks.append (Chunk ((min (nums), max (nums)+1),
- last_c, ls, file))
- chunk = []
+ if chunk:
+ nums = [n-1 for (n, l) in chunk]
+ chunks.append (SchemeChunk ((min (nums), max (nums)+1),
+ max (last_c, 0), ls, file))
+ chunk[:] = []
last_c = -1
- for (c, n, l) in ls:
-
- if l.startswith ('(define'):
+ for (cov_count, line_number, line) in ls:
+ if line.startswith ('(define'):
new_chunk ()
- last_c =
- continue
+ last_c = -1
- if not (c == last_c or c < 0):
+ chunk.append ((line_number, line))
+ if cov_count >= 0:
+ last_c = cov_count
-
- if chunk and last_c >= 0:
-
- chunk.append ((n,l))
- if c >= 0:
- last_c = c
-
return chunks
def widen_chunk (ch, ls):
if options.uncovered:
chunks = filter_uncovered (chunks)
- chunks = [(c.length (), c) for c in chunks]
+ chunks = [(c.uncovered_score (), c) for c in chunks]
elif options.hotspots:
chunks = [((c.coverage_count, -c.length()), c) for c in chunks]