Skip to content

Commit

Permalink
Issue #279: filter: Exlude '[#should_panic]' lines by default
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Dec 2, 2018
1 parent ab4774d commit 32eda27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class BasicFilter : public IFilter
m_lineEndPatterns.push_back("LCOV_EXCL_STOP");

m_ignoreSingleLinePatterns.push_back("LCOV_EXCL_LINE");
m_ignoreSingleLinePatterns.push_back("#[should_panic]");

// Handle command line options
std::string cmd = IConfiguration::getInstance().keyAsString(
Expand Down
4 changes: 4 additions & 0 deletions tests/bash/other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ echo "Also not covered"
echo "Also not covered?"
# CUSTOM_RANGE_END
echo "Covered"

# Rust stuff
echo "Not covered" # #[should_panic]
echo "Maybe covered" # unreachable!
4 changes: 4 additions & 0 deletions tests/tools/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def runTest(self):
assert parse_cobertura.hitsPerLine(dom, "other.sh", 49) == None
assert parse_cobertura.hitsPerLine(dom, "other.sh", 51) == 1

# Rust stuff
assert parse_cobertura.hitsPerLine(dom, "other.sh", 54) == None
assert parse_cobertura.hitsPerLine(dom, "other.sh", 55) == 1

# Issue #224
class bash_can_find_non_executed_scripts(testbase.KcovTestCase):
def runTest(self):
Expand Down

0 comments on commit 32eda27

Please sign in to comment.