Skip to content

Commit 8d03468

Browse files
author
George Cook
committed
bounce to 3.0.0-beta
1 parent dd5cf42 commit 8d03468

25 files changed

+916
-447
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rooibos CHANGELOG
22

3-
## 3.0.0
3+
## 3.0.0-beta
44

55
### Added
66

@@ -15,6 +15,8 @@
1515
### Removed
1616

1717
### Fixed
18+
- #45 - crash when checking an expect param, and one of the params is a mock/stub
19+
- #40 - can now use / in the params - much better parsing, too
1820

1921
## 2.3.0
2022

dist/rooibosDist.brs

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'/**
22
' * rooibos - simple, flexible, fun brightscript test framework for roku scenegraph apps
3-
' * @version v2.3.0
3+
' * @version v3.0.0-beta
44
' * @link https://github.com/georgejecook/rooibos#readme
55
' * @license MIT
66
' */
@@ -674,13 +674,15 @@ function RBS_BTS_EqAssocArray(Value1 , Value2 ) as dynamic
674674
return false
675675
else
676676
for each k in Value1
677-
if not Value2.DoesExist(k)
678-
return false
679-
else
680-
v1 = Value1[k]
681-
v2 = Value2[k]
682-
if not RBS_BTS_EqValues(v1, v2)
677+
if k <> "__mocks" and k <> "__stubs" 'fix infinite loop/box crash when doing equals on an aa with a mock
678+
if not Value2.DoesExist(k)
683679
return false
680+
else
681+
v1 = Value1[k]
682+
v2 = Value2[k]
683+
if not RBS_BTS_EqValues(v1, v2)
684+
return false
685+
end if
684686
end if
685687
end if
686688
end for
@@ -2032,6 +2034,9 @@ sub RBS_TR_Run()
20322034
skipSuite:
20332035
end for
20342036
m.logger.PrintStatistic(totalStatObj)
2037+
if RBS_CMN_IsFunction(RBS_ReportCodeCoverage)
2038+
RBS_ReportCodeCoverage()
2039+
end if
20352040
RBS_TR_SendHomeKeypress()
20362041
end sub
20372042
sub RBS_RT_RunItGroups(metaTestSuite, totalStatObj, testUtilsDecoratorMethodName, config, runtimeConfig, nodeContext = invalid)

docs/Rooibos.brs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ <h1 class="page-title">Rooibos.brs</h1>
126126
<br class="clear">
127127

128128
<footer>
129-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
129+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
130130
</footer>
131131

132132
<script>prettyPrint();</script>

docs/Rooibos_BaseTestSuite.brs.html

+9-7
Original file line numberDiff line numberDiff line change
@@ -1053,13 +1053,15 @@ <h1 class="page-title">Rooibos_BaseTestSuite.brs</h1>
10531053
return false
10541054
else
10551055
for each k in Value1
1056-
if not Value2.DoesExist(k)
1057-
return false
1058-
else
1059-
v1 = Value1[k]
1060-
v2 = Value2[k]
1061-
if not RBS_BTS_EqValues(v1, v2)
1056+
if k &lt;> "__mocks" and k &lt;> "__stubs" 'fix infinite loop/box crash when doing equals on an aa with a mock
1057+
if not Value2.DoesExist(k)
10621058
return false
1059+
else
1060+
v1 = Value1[k]
1061+
v2 = Value2[k]
1062+
if not RBS_BTS_EqValues(v1, v2)
1063+
return false
1064+
end if
10631065
end if
10641066
end if
10651067
end for
@@ -2003,7 +2005,7 @@ <h1 class="page-title">Rooibos_BaseTestSuite.brs</h1>
20032005
<br class="clear">
20042006

20052007
<footer>
2006-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
2008+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
20072009
</footer>
20082010

20092011
<script>prettyPrint();</script>

docs/Rooibos_CommonUtils.brs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ <h1 class="page-title">Rooibos_CommonUtils.brs</h1>
598598
<br class="clear">
599599

600600
<footer>
601-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
601+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
602602
</footer>
603603

604604
<script>prettyPrint();</script>

docs/Rooibos_ItemGenerator.brs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ <h1 class="page-title">Rooibos_ItemGenerator.brs</h1>
273273
<br class="clear">
274274

275275
<footer>
276-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
276+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
277277
</footer>
278278

279279
<script>prettyPrint();</script>

docs/Rooibos_TestRunner.brs.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
188188
end if
189189
skipSuite:
190190
end for
191-
192191
m.logger.PrintStatistic(totalStatObj)
192+
193+
if RBS_CMN_IsFunction(RBS_ReportCodeCoverage)
194+
RBS_ReportCodeCoverage()
195+
end if
193196
RBS_TR_SendHomeKeypress()
194197
end sub
195198

@@ -292,6 +295,7 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
292295
end if
293296

294297
testTimer = CreateObject("roTimespan")
298+
testCaseTimer = CreateObject("roTimespan")
295299
testStatObj = RBS_STATS_CreateTestStatistic(testCase.Name)
296300
testSuite.testCase = testCase.Func
297301
testStatObj.filePath = metaTestSuite.filePath
@@ -315,6 +319,7 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
315319
end if
316320
testCaseParams.push(paramValue)
317321
end for
322+
testCaseTimer.mark()
318323
'up to 6 param args supported for now
319324
if (metaTestCase.expectedNumberOfParams = 1)
320325
testSuite.testCase(testCaseParams[0])
@@ -329,8 +334,11 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
329334
else if (metaTestCase.expectedNumberOfParams = 6)
330335
testSuite.testCase(testCaseParams[0], testCaseParams[1], testCaseParams[2], testCaseParams[3], testCaseParams[4], testCaseParams[5])
331336
end if
337+
metaTestCase.time = testCaseTimer.totalMilliseconds()
332338
else
339+
testCaseTimer.mark()
333340
testSuite.testCase()
341+
metaTestCase.time = testCaseTimer.totalMilliseconds()
334342
end if
335343
else
336344
testSuite.Fail("Could not parse args for test ")
@@ -428,7 +436,7 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
428436
<br class="clear">
429437

430438
<footer>
431-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
439+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
432440
</footer>
433441

434442
<script>prettyPrint();</script>

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<br class="clear">
5858

5959
<footer>
60-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
60+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
6161
</footer>
6262

6363
<script>prettyPrint();</script>

docs/module-BaseTestSuite.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12420,7 +12420,7 @@ <h5>Returns:</h5>
1242012420
<br class="clear">
1242112421

1242212422
<footer>
12423-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
12423+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
1242412424
</footer>
1242512425

1242612426
<script>prettyPrint();</script>

docs/module-CommonUtils.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5062,7 +5062,7 @@ <h5>Returns:</h5>
50625062
<br class="clear">
50635063

50645064
<footer>
5065-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
5065+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
50665066
</footer>
50675067

50685068
<script>prettyPrint();</script>

docs/module-ItemGenerator.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ <h5>Returns:</h5>
14421442
<br class="clear">
14431443

14441444
<footer>
1445-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
1445+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
14461446
</footer>
14471447

14481448
<script>prettyPrint();</script>

docs/module-TestRunner.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ <h4 class="name" id="Run"><span class="type-signature"></span>Run<span class="si
651651
<br class="clear">
652652

653653
<footer>
654-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
654+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
655655
</footer>
656656

657657
<script>prettyPrint();</script>

docs/module-rooibosh.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ <h5>Parameters:</h5>
294294
<br class="clear">
295295

296296
<footer>
297-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme.
297+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
298298
</footer>
299299

300300
<script>prettyPrint();</script>
+48-21
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
sub Main(args as dynamic)
2-
if (type(Rooibos__Init) = "Function") then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m)
2+
if RBS_CC_1_reportLine(1, 2) and ((type(Rooibos__Init) = "Function")) then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m)
33

4-
InitScreen()
4+
RBS_CC_1_reportLine(3, 1): InitScreen()
55
end sub
66

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

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

17-
screen.show()
17+
RBS_CC_1_reportLine(16, 1): screen.show()
1818

19-
SetupGlobals(screen)
19+
RBS_CC_1_reportLine(18, 1): SetupGlobals(screen)
2020

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

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

41-
m.global = screen.getGlobalNode()
41+
RBS_CC_1_reportLine(40, 1): m.global = screen.getGlobalNode()
4242

43-
m.roDeviceInfo = CreateObject("roDeviceInfo")
43+
RBS_CC_1_reportLine(42, 1): m.roDeviceInfo = CreateObject("roDeviceInfo")
4444

45-
m.displayInfo = {
45+
RBS_CC_1_reportLine(44, 1): m.displayInfo = {
4646
resolution: m.roDeviceInfo.GetUIResolution()
4747
displayType: m.roDeviceInfo.GetDisplayType()
4848
width: m.roDeviceInfo.GetDisplaySize().w
@@ -51,7 +51,34 @@ function SetupGlobals(screen) as void
5151
hFactor: m.roDeviceInfo.GetDisplaySize().h/1080
5252
}
5353

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

56-
m.global.addFields({"modelLocator": m.modelLocator})
56+
RBS_CC_1_reportLine(55, 1): m.global.addFields({"modelLocator": m.modelLocator})
57+
end function
58+
59+
60+
61+
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
62+
'++ rooibos code coverage util functions DO NOT MODIFY
63+
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
64+
65+
function RBS_CC_1_reportLine(lineNumber, reportType = 1)
66+
if m.global = invalid
67+
'? "global is not available in this scope!! it is not possible to record coverage: #FILE_PATH#(lineNumber)"
68+
return true
69+
else
70+
if m._rbs_ccn = invalid
71+
'? "Coverage maps are not created - creating now"
72+
if m.global._rbs_ccn = invalid
73+
'? "Coverage maps are not created - creating now"
74+
m.global.addFields({
75+
"_rbs_ccn": createObject("roSGnode", "CodeCoverage")
76+
})
77+
end if
78+
m._rbs_ccn = m.global._rbs_ccn
79+
end if
80+
end if
81+
82+
m._rbs_ccn.entry = {"f":"1", "l":stri(lineNumber), "r":reportType}
83+
return true
5784
end function

0 commit comments

Comments
 (0)