Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdp authored Feb 13, 2024
1 parent 73b4d95 commit d59ba42
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
1 change: 0 additions & 1 deletion framework/src/source/BaseTestSuite.bs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ namespace rooibos
? ` Location: file://${test.testSuite.filePath.trim()}:${test.lineNumber}`
? ""

m.global._rbs_ccn.testName = test.name
m.currentResult = test.result
m.currentResult.throwOnFailedAssertion = m.throwOnFailedAssertion
if m.catchCrashes and not test.noCatch and not m.noCatch
Expand Down
35 changes: 0 additions & 35 deletions framework/src/source/CodeCoverage.brs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#const rooibos_poc_enhanced_lcov_support = false

function init()
m.resolvedMap = {}
m.resolvedTestMap = {}
m.top.observeField("entry", "onEntryChange")
m.top.observeField("save", "onSave")
m.resultsByTest = {}
m.results = []
end function

Expand All @@ -20,17 +16,6 @@ end function
function onEntryChange()
entry = m.top.entry
' defer till later

#if rooibos_poc_enhanced_lcov_support
testName = m.top.testName
if testName <> ""
if not m.resultsByTest.doesExist(testName)
m.resultsByTest[testName] = []
end if
m.resultsByTest[testName].push(entry)
end if
#end if

m.results.push(entry)
end function

Expand All @@ -49,26 +34,6 @@ function onSave()
end if
end for
m.top.resolvedMap = m.resolvedMap

#if rooibos_poc_enhanced_lcov_support
for each testName in m.resultsByTest
resolvedTest = m.resultsByTest[testName]
m.resolvedTestMap[testName] = {}
for each entry in resolvedTest
if entry <> invalid
fileId = entry.f
lineMap = m.resolvedTestMap[testName][fileId]

if lineMap = invalid
lineMap = {}
m.resolvedTestMap[testName][fileId] = lineMap
end if
lineMap[entry.l] = entry.r
end if
end for
end for
m.top.resolvedTestMap = m.resolvedTestMap
#end if
setExpectedMap()
setFilePathMap()
end function
2 changes: 0 additions & 2 deletions framework/src/source/CodeCoverage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
<interface>
<field id="entry" type="assocarray" />
<field id="save" type="boolean" />
<field id="testName" type="string" />
<field id="expectedMap" type="assocarray" />
<field id="resolvedMap" type="assocarray" />
<field id="resolvedTestMap" type="assocarray" />
<field id="filePathMap" type="assocarray" />
</interface>
</component>

0 comments on commit d59ba42

Please sign in to comment.