Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.

Commit b089154

Browse files
authored
Merge pull request #3 from mjcaisse/no-location-tag
if location is missing, use an empty_string for file_name in JUnit output.
2 parents 28deeb0 + 8e39d33 commit b089154

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cppcheck_junit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ def generate_test_suite(errors):
117117
for file_name, errors in errors.items():
118118
test_case = ElementTree.SubElement(test_suite,
119119
'testcase',
120-
name=os.path.relpath(file_name))
120+
name=os.path.relpath(file_name) if file_name else '')
121121
for error in errors:
122122
ElementTree.SubElement(test_case,
123123
'error',
124-
file=os.path.relpath(error.file),
124+
file=os.path.relpath(error.file) if error.file else '',
125125
line=str(error.line),
126126
message='{}: ({}) {}'.format(error.line,
127127
error.severity,

0 commit comments

Comments
 (0)