-
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.
chore(tests): Adds node test to framework suite, and also improves th…
…e file structure to include placeholder files, so as to better conform with brighterscript compiler
- Loading branch information
1 parent
c4277d6
commit f23b81d
Showing
8 changed files
with
121 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function Init() as void | ||
m.nameText = m.top.findNode("nameText") | ||
end function | ||
|
||
function HelloFromNode(name, age) as string | ||
return "HELLO " + name + " age:" + stri(age) | ||
end function | ||
|
||
function UpdateState(newState) as void | ||
m.top.state = newState | ||
end function | ||
|
||
function SetLabelText(newText) as void | ||
m.nameText.text = newText | ||
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,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component | ||
name="NodeExample" | ||
extends="Group" | ||
> | ||
<interface> | ||
<!-- public fields/functions --> | ||
<field | ||
type="string" | ||
id="state" /> | ||
</interface> | ||
|
||
<script | ||
type="text/brightscript" | ||
uri="NodeExample.brs" /> | ||
|
||
|
||
<children> | ||
<Label | ||
id="nameText" | ||
text="name" /> | ||
|
||
<Button | ||
id="button1" | ||
text="button1" /> | ||
<Button | ||
id="button2" | ||
text="button2" /> | ||
</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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
<?xml version='1.0' encoding='UTF-8' ?> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<component | ||
name='TestsScene' | ||
extends='Scene'> | ||
name="TestsScene" | ||
extends="Scene"> | ||
<script | ||
type="text/brightscript" | ||
uri="pkg:/source/rooibosFunctionMap.brs" /> | ||
<script | ||
type="text/brightscript" | ||
uri="pkg:/source/tests/rooibosDist.brs" /> | ||
|
||
<interface> | ||
<function name="Rooibos_CreateTestNode"/> | ||
</interface> | ||
<children> | ||
<LayoutGroup> | ||
<Label text='Rooibos tests are running' /> | ||
<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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component | ||
name="NodeExampleTests" | ||
extends="NodeExample" | ||
xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd" | ||
> | ||
<interface> | ||
<!-- public fields/functions --> | ||
<!-- <function name="Rooibos_RunNodeTests" /> --> | ||
</interface> | ||
|
||
<script | ||
type="text/brightscript" | ||
uri="pkg:/source/tests/NodeExampleTests.brs" /> | ||
|
||
<script | ||
type="text/brightscript" | ||
uri="pkg:/source/rooibosFunctionMap.brs" /> | ||
|
||
<script | ||
type="text/brightscript" | ||
uri="pkg:/source/tests/rooibosDist.brs" /> | ||
|
||
</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,36 @@ | ||
'@SGNode NodeExampleTests | ||
'@TestSuite [NET] Node Example Tests | ||
|
||
'@Setup | ||
function NET_setup() as void | ||
m.setupThing = "something created during setup" | ||
end function | ||
|
||
'@Only | ||
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
'@It tests methods present on the node | ||
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
'@BeforeEach | ||
function NET_BeforeEach() as void | ||
m.beforeEachThing = "something created beforeEach" | ||
end function | ||
|
||
'@Test HelloFromNode | ||
function NET__HelloFromNode_simple() as void | ||
text = HelloFromNode("georgejecook", 12) | ||
m.AssertEqual(text, "HELLO georgejecook" + " age:" + stri(12)) | ||
end function | ||
|
||
'@Test HelloFromNode with params | ||
'@Params["jon", 40] | ||
'@Params["ringo", 23] | ||
'@Params["ringo", 50] | ||
'@Params["ringo", 24] | ||
'@Params["george", 40] | ||
'@Params["paul", 50] | ||
function NET__HelloFromNode_params(name, age) as void | ||
text = HelloFromNode(name, age) | ||
m.AssertEqual(text, "HELLO " + name + " age:" + stri(age)) | ||
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 @@ | ||
'replaced at build time |
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