mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
Add test count to JUnit reporter (#6319)
This commit is contained in:
committed by
GitHub
parent
4581152312
commit
4cca8280f6
@@ -11,11 +11,12 @@ struct JUnitReporter: Reporter {
|
||||
static func generateReport(_ violations: [StyleViolation]) -> String {
|
||||
let warningCount = violations.filter({ $0.severity == .warning }).count
|
||||
let errorCount = violations.filter({ $0.severity == .error }).count
|
||||
let testCount = warningCount + errorCount
|
||||
|
||||
return """
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<testsuites failures="\(warningCount)" errors="\(errorCount)">
|
||||
\t<testsuite failures="\(warningCount)" errors="\(errorCount)">
|
||||
<testsuites failures="\(warningCount)" errors="\(errorCount)" tests="\(testCount)">
|
||||
\t<testsuite failures="\(warningCount)" errors="\(errorCount)" tests="\(testCount)">
|
||||
\(violations.map(testCase(for:)).joined(separator: "\n"))
|
||||
\t</testsuite>
|
||||
</testsuites>
|
||||
|
||||
Reference in New Issue
Block a user