aboutsummaryrefslogtreecommitdiff
path: root/contrib/filter-lcov.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/filter-lcov.py')
-rwxr-xr-xcontrib/filter-lcov.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/filter-lcov.py b/contrib/filter-lcov.py
index ce2966c43d..299377d691 100755
--- a/contrib/filter-lcov.py
+++ b/contrib/filter-lcov.py
@@ -3,7 +3,7 @@
import argparse
parser = argparse.ArgumentParser(description='Remove the coverage data from a tracefile for all files matching the pattern.')
-parser.add_argument('pattern', help='the pattern of files to remove')
+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')
@@ -16,8 +16,9 @@ in_remove = False
with open(tracefile, 'r') as f:
with open(outfile, 'w') as wf:
for line in f:
- if line.startswith("SF:") and pattern in line:
- in_remove = True
+ 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':