-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.2.0 - adds ability to pass node scope into the test runner, for non…
…-node tests so node-scoped functions/vars can be accessed
- Loading branch information
George Cook
committed
Apr 27, 2019
1 parent
189b1be
commit 67527eb
Showing
24 changed files
with
3,321 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.1.4 | ||
2.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'@TestSuite [BT] Basic tests | ||
|
||
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
'@It tests the node context is available for a Node scope function | ||
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
'@Test | ||
function BT_NodeScope() as void | ||
m.assertNotInvalid(m.node) | ||
BT_doSomethingInNodeScope(true) | ||
m.assertInvalid(m._isNodeScopeVarSet) | ||
m.assertTrue(m.node._isNodeScopeVarSet) | ||
end function | ||
|
||
function BT_doSomethingInNodeScope(value) | ||
m._isNodeScopeVarSet = value | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component name="TestsScene" extends="Scene"> | ||
<children> | ||
<LayoutGroup> | ||
<Label text="Rooibos tests are running" /> | ||
</LayoutGroup> | ||
</children> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
title=Rooibos | ||
major_version=0 | ||
minor_version=2 | ||
build_version=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
sub Main(args as dynamic) | ||
if (type(Rooibos__Init) = "Function") then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m) | ||
|
||
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 | ||
screen = CreateObject("roSGScreen") | ||
m.port = CreateObject("roMessagePort") | ||
screen.setMessagePort(m.port) | ||
|
||
rootScene = screen.CreateScene("TestsScene") | ||
rootScene.id = "ROOT" | ||
|
||
screen.show() | ||
|
||
SetupGlobals(screen) | ||
|
||
while(true) | ||
msg = wait(0, m.port) | ||
msgType = type(msg) | ||
|
||
if msgType = "roSGScreenEvent" | ||
if msg.isScreenClosed() | ||
return | ||
end if | ||
end if | ||
end while | ||
end function | ||
|
||
|
||
'************************************************************* | ||
'** SetupGlobals | ||
'** @param screen as roScreen - screen to set globals on | ||
'************************************************************* | ||
function SetupGlobals(screen) as void | ||
? "SETTTING UP GLOBALS - do your standard setup stuff here" | ||
|
||
m.global = screen.getGlobalNode() | ||
|
||
m.roDeviceInfo = CreateObject("roDeviceInfo") | ||
|
||
m.displayInfo = { | ||
resolution: m.roDeviceInfo.GetUIResolution() | ||
displayType: m.roDeviceInfo.GetDisplayType() | ||
width: m.roDeviceInfo.GetDisplaySize().w | ||
height: m.roDeviceInfo.GetDisplaySize().h | ||
wFactor: m.roDeviceInfo.GetDisplaySize().w/1920 | ||
hFactor: m.roDeviceInfo.GetDisplaySize().h/1080 | ||
} | ||
|
||
m.modelLocator = {"displayInfo":m.displayInfo} ' contrived example : this would be a specifc modelLocator node/other setup thing | ||
|
||
m.global.addFields({"modelLocator": m.modelLocator}) | ||
end function |
Oops, something went wrong.