mirror of
https://github.com/unclebob/crapper.git
synced 2026-11-26 18:18:49 +00:00
Resolve Swift coverage regions through each function's filenames.
llvm-cov region[5] indexes that function's filenames, not unit["files"]. On Apple LLVM 21 those orders differ, so the span covering Place.swift line 5 was stored on test_entry_point.swift and the return stayed uncovered. Proved by tests/fixtures/swift/function-filenames.json, which failed before the fix (Place.swift received (1, 1, 1) instead of (4, 5, 1)). 226 pytest tests passed. crapper worst CRAP on coverage.py is 9.0. dryer found no candidates at 0.8 in coverage.py. mutator on coverage.py: 237 killed, 0 survived, 0 uncovered. Co-authored-by: Robert C. Martin <[email protected]>
This commit is contained in:
co-authored by
Robert C. Martin
parent
127ed34454
commit
53865e4a31
+39
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"type": "llvm.coverage.json.export",
|
||||
"version": "2.0.1",
|
||||
"data": [
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"filename": "/proj/DerivedSources/test_entry_point.swift",
|
||||
"segments": [
|
||||
[1, 1, 1, true, true, false]
|
||||
]
|
||||
},
|
||||
{
|
||||
"filename": "/proj/Sources/Demo/Place.swift",
|
||||
"segments": [
|
||||
[1, 1, 3, true, true, false],
|
||||
[2, 1, 3, true, true, false],
|
||||
[4, 1, 1, true, true, false],
|
||||
[5, 13, 3, true, false, false]
|
||||
]
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"name": "place(x:)",
|
||||
"count": 1,
|
||||
"filenames": [
|
||||
"/proj/Sources/Demo/Place.swift",
|
||||
"/proj/DerivedSources/test_entry_point.swift"
|
||||
],
|
||||
"regions": [
|
||||
[4, 6, 5, 13, 1, 0, 0, 0],
|
||||
[1, 1, 1, 8, 1, 1, 0, 0]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user