Skip to content

Commit

Permalink
adds path to test suite output
Browse files Browse the repository at this point in the history
  • Loading branch information
George Cook committed May 28, 2019
1 parent f388804 commit 73f0d17
Show file tree
Hide file tree
Showing 25 changed files with 351 additions and 583 deletions.
4 changes: 2 additions & 2 deletions dist/rooibosDist.brs
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ sub RBS_LOGGER_PrintTestStatistic(testCase as object)
testChar = "|"
locationLine = StrI(metaTestCase.lineNumber).trim()
end if
locationText = testCase.filePath.trim() + "(" + locationLine + ")"
locationText = "pkg:/" + testCase.filePath.trim() + "(" + locationLine + ")"
insetText = ""
if (metaTestcase.isParamTest <> true)
messageLine = RBS_LOGGER_FillText(" " + testChar + " |--" + metaTestCase.Name + " : ", ".", 80)
Expand Down Expand Up @@ -1864,7 +1864,7 @@ sub RBS_LOGGER_PrintSuiteSetUp(sName as string)
end if
end sub
sub RBS_LOGGER_PrintMetaSuiteStart(metaTestSuite)
? metaTestSuite.name; " (" ; metaTestSuite.filePath + "(1))"
? metaTestSuite.name; " " ; "pkg:/" ; metaTestSuite.filePath + "(1)"
end sub
sub RBS_LOGGER_PrintSuiteStart(sName as string)
? " |-" ; sName
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h1 class="page-title">Rooibos.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:27 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos_BaseTestSuite.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ <h1 class="page-title">Rooibos_BaseTestSuite.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:27 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos_CommonUtils.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ <h1 class="page-title">Rooibos_CommonUtils.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:27 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos_ItemGenerator.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h1 class="page-title">Rooibos_ItemGenerator.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:27 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos_TestRunner.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:27 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:27 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,10 @@ Recording coverage means modifying your sources! you should only run the coverag

These files should be cleaned and recopied _every time you run coverage_ or you will get compile errors/other undetermined behaviour.

#### WARNING - Running code coverage is slower and may crash your device

Running a code coverage report is a lot slower than a standard test, due to conitnual probing of your source. Only run coverage when needed. Also - be aware it will crash very tight loops, like inside of a while waiting on a port, which will in fact crash and hard reset your device.

### Recording coverage
To record coverage, set the `sourceFilePattern` to a glob matching (including and excluding) the files that should be included in your coverage report, and set the `isRecordingCodeCoverage` flag to true. Be careful to not include your test specs!!

Expand Down
2 changes: 1 addition & 1 deletion docs/module-BaseTestSuite.html
Original file line number Diff line number Diff line change
Expand Up @@ -12420,7 +12420,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:28 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-CommonUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -5062,7 +5062,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:28 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-ItemGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:28 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-TestRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ <h4 class="name" id="Run"><span class="type-signature"></span>Run<span class="si
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:28 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-rooibosh.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon May 27 2019 21:13:28 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 28 2019 11:14:36 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
69 changes: 21 additions & 48 deletions outRun/.roku-deploy-staging/source/main.brs
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
sub Main(args as dynamic)
if RBS_CC_1_reportLine(1, 2) and ((type(Rooibos__Init) = "Function")) then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m)
if (type(Rooibos__Init) = "Function") then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m)

RBS_CC_1_reportLine(3, 1): InitScreen()
InitScreen()
end sub

function InitScreen() as void
'this will be where you setup your typical roku app
'it will not be launched when running unit tests
RBS_CC_1_reportLine(9, 1): screen = CreateObject("roSGScreen")
RBS_CC_1_reportLine(10, 1): m.port = CreateObject("roMessagePort")
RBS_CC_1_reportLine(11, 1): screen.setMessagePort(m.port)
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)

RBS_CC_1_reportLine(13, 1): rootScene = screen.CreateScene("TestsScene")
RBS_CC_1_reportLine(14, 1): rootScene.id = "ROOT"
rootScene = screen.CreateScene("TestsScene")
rootScene.id = "ROOT"

RBS_CC_1_reportLine(16, 1): screen.show()
screen.show()

RBS_CC_1_reportLine(18, 1): SetupGlobals(screen)
SetupGlobals(screen)

RBS_CC_1_reportLine(20, 1): while(true)
RBS_CC_1_reportLine(21, 1): msg = wait(0, m.port)
RBS_CC_1_reportLine(22, 1): msgType = type(msg)
while(true)
msg = wait(0, m.port)
msgType = type(msg)

if RBS_CC_1_reportLine(24, 2) and (msgType = "roSGScreenEvent")
if RBS_CC_1_reportLine(25, 2) and (msg.isScreenClosed())
RBS_CC_1_reportLine(26, 1): return
if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
return
end if
end if
end while
Expand All @@ -36,13 +36,13 @@ end function
'** @param screen as roScreen - screen to set globals on
'*************************************************************
function SetupGlobals(screen) as void
RBS_CC_1_reportLine(38, 1): ? "SETTTING UP GLOBALS - do your standard setup stuff here"
? "SETTTING UP GLOBALS - do your standard setup stuff here"

RBS_CC_1_reportLine(40, 1): m.global = screen.getGlobalNode()
m.global = screen.getGlobalNode()

RBS_CC_1_reportLine(42, 1): m.roDeviceInfo = CreateObject("roDeviceInfo")
m.roDeviceInfo = CreateObject("roDeviceInfo")

RBS_CC_1_reportLine(44, 1): m.displayInfo = {
m.displayInfo = {
resolution: m.roDeviceInfo.GetUIResolution()
displayType: m.roDeviceInfo.GetDisplayType()
width: m.roDeviceInfo.GetDisplaySize().w
Expand All @@ -51,34 +51,7 @@ RBS_CC_1_reportLine(44, 1): m.displayInfo = {
hFactor: m.roDeviceInfo.GetDisplaySize().h/1080
}

RBS_CC_1_reportLine(53, 1): m.modelLocator = {"displayInfo":m.displayInfo} ' contrived example : this would be a specifc modelLocator node/other setup thing
m.modelLocator = {"displayInfo":m.displayInfo} ' contrived example : this would be a specifc modelLocator node/other setup thing

RBS_CC_1_reportLine(55, 1): m.global.addFields({"modelLocator": m.modelLocator})
end function



'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++ rooibos code coverage util functions DO NOT MODIFY
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function RBS_CC_1_reportLine(lineNumber, reportType = 1)
if m.global = invalid
'? "global is not available in this scope!! it is not possible to record coverage: #FILE_PATH#(lineNumber)"
return true
else
if m._rbs_ccn = invalid
'? "Coverage maps are not created - creating now"
if m.global._rbs_ccn = invalid
'? "Coverage maps are not created - creating now"
m.global.addFields({
"_rbs_ccn": createObject("roSGnode", "CodeCoverage")
})
end if
m._rbs_ccn = m.global._rbs_ccn
end if
end if

m._rbs_ccn.entry = {"f":"1", "l":stri(lineNumber), "r":reportType}
return true
m.global.addFields({"modelLocator": m.modelLocator})
end function
Loading

0 comments on commit 73f0d17

Please sign in to comment.