Skip to content

Commit c4c0164

Browse files
committed
feat: initialized all metrics to 0 so that none are empty at the end
1 parent 10f4e2d commit c4c0164

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cls/TestCoverage/Data/Run.cls

+11-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ ClassMethod MapRunCoverage(pRunIndex As %Integer) As %Status
101101
Do tCoverage.RunSetObjectId(pRunIndex)
102102
Do tCoverage.HashSetObjectId(hToHash)
103103
Set tCoverage.TestPath = hTestPath
104+
// also set all of its metrics to 0 to start with
105+
Set tCodeUnit = ##class(TestCoverage.Data.CodeUnit).%OpenId(hToHash)
106+
For i=1:1:tRun.Metrics.Count() {
107+
Set tMetricKey = tRun.Metrics.GetAt(i)
108+
Set tMetric = $PROPERTY(tCoverage, tMetricKey)
109+
for tLineNumber = 1:1:tCodeUnit.Lines.Count() {
110+
Do tMetric.SetAt(0, tLineNumber)
111+
}
112+
}
113+
114+
104115
}
105116
Set tCoverage.Ignore = hIgnore
106117
Set tCoverage.CoveredLines = $BitLogic(tCoverage.CoveredLines|hCoveredLines)
@@ -191,4 +202,3 @@ Storage Default
191202
}
192203

193204
}
194-

0 commit comments

Comments
 (0)