Search Issue Tracker
Won't Fix
Votes
16
Found in
2021.3.4f1
2023.2.0a1
Issue ID
UUM-15006
Regression
No
Coverage.GetStatsFor API shows 0 hits for generic methods
Steps to reproduce:
# Open attached project
# Enable Code Coverage by pressing Test/Toggle
# Open Test Runner and run all editor tests
# Click Test/Cov to print coverage results
Actual result: Notice that hitCount for lines 26, 27 and 28 is 0
Using Coverage.GetStatsForAllCoveredMethods instead of Coverage.GetStatsFor will return correct hitCount. Open TestGenerics.cs, comment line 15 and uncomment line 16. Redo repro steps. Notice that now hitCount on lines 26, 27 and 28 is 1.
Reproduced with: 2021.3.4f1
-
JuliusJ
Mar 27, 2023 13:11
This issue is for the Code Coverage API and not the Code Coverage package.
There was a regression in the Code Coverage package which caused a similar issue. It was fixed in version 1.2.3 of the package and can be tracked here:
https://issuetracker.unity3d.com/issues/coverage-package-fails-to-gather-any-coverage-for-generic-methods -
SpectaluarTree
Feb 28, 2023 01:33
The issue seems to appear on package version "1.2.2", but not on "1.1.1".
As a temporary solution we can use the older version -
yilin-li
Feb 02, 2023 07:39
Reproduced on version 2021.3.17f1
-
brunobiluca
Jan 16, 2023 18:14
Reproduced on version 2021.3.16f1
-
nic_mothandflame
Jan 14, 2023 00:16
Reproduced on version 2020.3.39f1
-
willykc
Oct 27, 2022 17:32
Reproduced on version 2020.3.33
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Dragon Crashers] Build fails in U6
- [Dragon Crashers] 4 Shader error messages on import
- [Dragon Crashers] Readme text is white on light grey
- Cursor stays in front of the first character when entering text in the TextMeshPro field
- Searching in Hierarchy causes unwanted component calls
Resolution Note:
Fixed in the Code Coverage package. See issue COV-17 at https://issuetracker.unity3d.com/issues/coverage-package-fails-to-gather-any-coverage-for-generic-methods