-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Hi,
AFAIK, the xccov-to-sonarqube-generic.sh is not accounting with multiple code branches in the same line, like ternary operators of nil coalescing fallbacks.
e.g.:
Using this snippet we can see that we have 2 different code paths:
testBool(optionalBool ?? false)optionalBoolexists and its value is usedoptionalBoolisniland we are coalescing tofalse
From a random export of xcrun xccov view --archive App.xcresult:
(this is not a match from the snippet above, only an example)
/Users/Random/work/app-ios/Sources/Model.swift:
...
59: 0
60: 0
61: 2 [
(1, 9, 0)
]
62: 2
63: 2
64: 8 [
(1, 67, 2)
(91, 0, 2)
]
65: 2
66: 2
67: 4 [
(1, 28, 2)
(97, 0, 2)
]
68: 2 [
(87, 1, 0)
]
69: 2
70: 2 [
(77, 2, 1)
]
71: 2
72: 2
73: *
...
Looking at the conversion script, it only cares about:
69: 2
70: 2
But there's extra info on the next line that is important to confirm if we have covered all the possible code branches:
70: 2 [
(77, 2, 1)
]
Questions:
- As of today, is that script the official way of reporting Swift code coverage from an
xcresult? - If so, shouldn't it support different code branches?
Thanks.
renato-anchor
Metadata
Metadata
Assignees
Labels
No labels