Permalink
Please sign in to comment.
Browse files
Merge #10565: [coverage] Remove subtrees and benchmarks from coverage…
… report d5711f4 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
- Loading branch information...
Showing
with
71 additions
and 29 deletions.
- +22 −29 Makefile.am
- +12 −0 configure.ac
- +25 −0 contrib/filter-lcov.py
- +12 −0 src/util.h
51
Makefile.am
12
configure.ac
| @@ -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 |
12
src/util.h
0 comments on commit
8c2098a