Skip to content

Commit 453671c

Browse files
Added max line coverage count to manage very (more than max int) high line coverage
* line coverage count higher than given max limit will be replaced with (MAX + 1)
1 parent 4818983 commit 453671c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

cpp_coveralls/coverage.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ def create_args(params):
7272
help='Follow symlinks (default off)')
7373
parser.add_argument('-l', '--lcov-file', metavar='FILE',
7474
help='Upload lcov generated info file')
75+
parser.add_argument('--max-cov-count', metavar='NUMBER',
76+
help='Max number for line coverage count. If line'
77+
'coverage count is greater than the given number'
78+
'(Max + 1) will be put instead. Helps in managing'
79+
'line coverage count which is higher than max int'
80+
'value supported by coveralls.')
7581

7682
return parser.parse_args(params)
7783

@@ -293,6 +299,9 @@ def parse_lcov_file_info(args, filepath, line_iter, line_coverage_re, file_end_s
293299
if line_coverage_match:
294300
line_no = line_coverage_match.group(1)
295301
cov_count = int(line_coverage_match.group(2))
302+
if args.max_cov_count:
303+
if cov_count > args.max_cov_count:
304+
cov_count = args.max_cov_count + 1
296305
lines_covered.append((line_no, cov_count))
297306
else:
298307
break

0 commit comments

Comments
 (0)