Skip to content

Commit

Permalink
Fix lcov exclusion keyword: end -> stop
Browse files Browse the repository at this point in the history
This amends 0538d1a: the correct keyword is LCOV_EXCL_STOP, not
LCOV_EXCL_END.
  • Loading branch information
remram44 committed Jul 13, 2015
1 parent 0f67cad commit da0f111
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions cpp_coveralls/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,14 @@ def parse_gcov_file(fobj, filename):
sys.stderr.write("Warning: %s:%d: nested LCOV_EXCL_START, "
"please fix\n" % (filename, line_num))
ignoring = True
elif re.search(r'\bLCOV_EXCL_END\b', text):
elif re.search(r'\bLCOV_EXCL_(STOP|END)\b', text):
if not ignoring:
sys.stderr.write("Warning: %s:%d: LCOV_EXCL_END outside of "
sys.stderr.write("Warning: %s:%d: LCOV_EXCL_STOP outside of "
"exclusion zone, please fix\n" % (filename,
line_num))
if 'LCOV_EXCL_END' in text:
sys.stderr.write("Warning: %s:%d: LCOV_EXCL_STOP is the "
"correct keyword\n" % (filename, line_num))
ignoring = False
if cov_num == '-':
coverage.append(None)
Expand Down
2 changes: 1 addition & 1 deletion test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int main() {
/* LCOV_EXCL_START */
a = 4;
a = 5;
/* LCOV_EXCL_END */
/* LCOV_EXCL_STOP */
a = 6;
}
if(a == 7) {
Expand Down

0 comments on commit da0f111

Please sign in to comment.