Browse Source
0.15d5711f4
Filter subtrees and and benchmarks from coverage report (Andrew Chow)405b86a
Replace lcov -r commands with faster way (Andrew Chow)c8914b9
Have `make cov` optionally include branch coverage statistics (Andrew Chow) Tree-SHA512: 9c349a7baeb7430ea586617c52f91177df58e3546d6dc573e26815ddb79e30ab1873542d85ac1daca5e1fb2c6d6c8965824b42d027b6b0496a744af57b095852
Wladimir J. van der Laan
8 years ago
4 changed files with 71 additions and 29 deletions
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3 |
||||
|
||||
import argparse |
||||
|
||||
parser = argparse.ArgumentParser(description='Remove the coverage data from a tracefile for all files matching the pattern.') |
||||
parser.add_argument('--pattern', '-p', action='append', help='the pattern of files to remove', required=True) |
||||
parser.add_argument('tracefile', help='the tracefile to remove the coverage data from') |
||||
parser.add_argument('outfile', help='filename for the output to be written to') |
||||
|
||||
args = parser.parse_args() |
||||
tracefile = args.tracefile |
||||
pattern = args.pattern |
||||
outfile = args.outfile |
||||
|
||||
in_remove = False |
||||
with open(tracefile, 'r') as f: |
||||
with open(outfile, 'w') as wf: |
||||
for line in f: |
||||
for p in pattern: |
||||
if line.startswith("SF:") and p in line: |
||||
in_remove = True |
||||
if not in_remove: |
||||
wf.write(line) |
||||
if line == 'end_of_record\n': |
||||
in_remove = False |
Loading…
Reference in new issue