Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
TBA
===

* To match how we group test cases, JUnit output ``failures`` count is now the amount of files with errors. (#431)
* Fixed a whitespace/newline false positive for control conditions containing lambdas. (#410)

2.0.2 (2025-04-08)
Expand Down
2 changes: 1 addition & 1 deletion cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ def AddJUnitFailure(self, filename, linenum, message, category, confidence):

def FormatJUnitXML(self):
num_errors = len(self._junit_errors)
num_failures = len(self._junit_failures)
num_failures = len({failure[0] for failure in self._junit_failures})

testsuite = xml.etree.ElementTree.Element("testsuite")
testsuite.attrib["errors"] = str(num_errors)
Expand Down
2 changes: 1 addition & 1 deletion cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5071,7 +5071,7 @@ def testJUnitXML(self):
]
expected = (
'<?xml version="1.0" encoding="UTF-8" ?>\n'
'<testsuite errors="0" failures="3" name="cpplint" tests="3">'
'<testsuite errors="0" failures="2" name="cpplint" tests="2">'
'<testcase name="File1"><failure>5: FailMsg1 [category/subcategory]'
" [3]\n19: FailMsg3 [category/subcategory] [3]</failure></testcase>"
'<testcase name="File2"><failure>99: FailMsg2 '
Expand Down
2 changes: 1 addition & 1 deletion samples/silly-sample/junit.def
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="0" failures="123" name="cpplint" tests="123"><testcase name="src/sillycode.cpp"><failure>0: No copyright message found. You should have a line: "Copyright [year] &lt;Copyright Owner&gt;" [legal/copyright] [5]
<testsuite errors="0" failures="2" name="cpplint" tests="2"><testcase name="src/sillycode.cpp"><failure>0: No copyright message found. You should have a line: "Copyright [year] &lt;Copyright Owner&gt;" [legal/copyright] [5]
1: Include the directory when naming header files [build/include_subdir] [4]
3: At least two spaces is best between code and comments [whitespace/comments] [2]
3: Should have a space between // and comment [whitespace/comments] [4]
Expand Down