diff --git a/docs/Rooibos.brs.html b/docs/Rooibos.brs.html index e750601f..9ceca1a3 100644 --- a/docs/Rooibos.brs.html +++ b/docs/Rooibos.brs.html @@ -57,16 +57,16 @@

Rooibos.brs

' * and therefore require a screen and scene are created. ' * @param nodeContext as object - this is the global scope of your tests - so where anonymous methods will run from. This should be m ' */ -function Rooibos__Init(preTestSetup = invalid, testUtilsDecoratorMethodName = invalid, testSceneName = invalid, nodeContext = invalid) as void +function Rooibos__Init(preTestSetup = invalid, testUtilsDecoratorMethodName = invalid, testSceneName = invalid, nodeContext = invalid) as void args = {} if createObject("roAPPInfo").IsDev() <> true then ? " not running in dev mode! - rooibos tests only support sideloaded builds - aborting" return end if - + args.testUtilsDecoratorMethodName = testUtilsDecoratorMethodName args.nodeContext = nodeContext - + screen = CreateObject("roSGScreen") m.port = CreateObject("roMessagePort") screen.setMessagePort(m.port) @@ -77,43 +77,66 @@

Rooibos.brs

scene = screen.CreateScene(testSceneName) scene.id = "ROOT" screen.show() - + m.global = screen.getGlobalNode() - m.global.addFields({"testsScene": scene}) + m.global.addFields({ "testsScene": scene }) if (preTestSetup <> invalid) preTestSetup(screen) end if - - + + testId = args.TestId if (testId = invalid) testId = "UNDEFINED_TEST_ID" end if - + ? "#########################################################################" ? "#TEST START : ###" ; testId ; "###" - + args.testScene = scene args.global = m.global + rooibosVersion = "3.1" + requiredRooibosPreprocessorVersion = "3.1.0" + + if not RBS_CMN_isFunction(RBSFM_getPreprocessorVersion) + versionError = "You are using a rooibos-preprocessor (i.e. rooibosC) version older than 3.1 - please update to " + requiredRooibosPreprocessorVersion + else + if RBSFM_getPreprocessorVersion() = requiredRooibosPreprocessorVersion + versionError = "" + else + versionError = "Your rooibos-preprocessor (i.e. rooibosC) version '" + RBSFM_getPreprocessorVersion() + "' is not compatible with rooibos version " + rooibosVersion + ". Please upgrade your rooibos-preprocessor to version " + requiredRooibosPreprocessorVersion + end if + end if - runner = RBS_TR_TestRunner(args) - runner.Run() - - while(true) - msg = wait(0, m.port) - msgType = type(msg) - if msgType = "roSGScreenEvent" - if msg.isScreenClosed() - return + if versionError = "" + ? "######################################################" + ? "" + ? "# rooibos framework version: " ; rooibosVersion + ? "# tests parsed with rooibosC version: " ; rooibosVersion + ? "######################################################" + ? "" + + runner = RBS_TR_TestRunner(args) + runner.Run() + + while(true) + msg = wait(0, m.port) + msgType = type(msg) + if msgType = "roSGScreenEvent" + if msg.isScreenClosed() + return + end if end if - end if - end while + end while + else + ? "" + ? "#########################################################" + ? "ERROR - VERSION MISMATCH" + ? versionError + ? "#########################################################" + end if end function - - - - @@ -126,7 +149,7 @@

Rooibos.brs


diff --git a/docs/Rooibos_BaseTestSuite.brs.html b/docs/Rooibos_BaseTestSuite.brs.html index e0df0955..88f75720 100644 --- a/docs/Rooibos_BaseTestSuite.brs.html +++ b/docs/Rooibos_BaseTestSuite.brs.html @@ -2005,7 +2005,7 @@

Rooibos_BaseTestSuite.brs


diff --git a/docs/Rooibos_CommonUtils.brs.html b/docs/Rooibos_CommonUtils.brs.html index bb94e232..f020f84d 100644 --- a/docs/Rooibos_CommonUtils.brs.html +++ b/docs/Rooibos_CommonUtils.brs.html @@ -54,7 +54,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains XMLElement interface, else return false ' */ -function RBS_CMN_IsXmlElement(value ) as boolean +function RBS_CMN_IsXmlElement(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifXMLElement") <> invalid end function @@ -66,7 +66,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains Function interface, else return false ' */ -function RBS_CMN_IsFunction(value ) as boolean +function RBS_CMN_IsFunction(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifFunction") <> invalid end function @@ -86,7 +86,7 @@

Rooibos_CommonUtils.brs

mapFunction = RBSFM_getFunctionsForFile(filename) if mapFunction <> invalid map = mapFunction() - if (type(map) ="roAssociativeArray") + if (type(map) = "roAssociativeArray") functionPointer = map[functionName] return functionPointer else @@ -94,7 +94,7 @@

Rooibos_CommonUtils.brs

end if end if return invalid - + end function ' /** @@ -113,14 +113,14 @@

Rooibos_CommonUtils.brs

' if func <> invalid ' return func ' end if - + filenames = RBSFM_getFilenames() for i = 0 to filenames.count() - 1 filename = filenames[i] mapFunction = RBSFM_getFunctionsForFile(filename) if mapFunction <> invalid map = mapFunction() - if (type(map) ="roAssociativeArray") + if (type(map) = "roAssociativeArray") functionPointer = map[functionName] if functionPointer <> invalid return functionPointer @@ -129,7 +129,7 @@

Rooibos_CommonUtils.brs

end if end for return invalid - + end function ' /** @@ -140,7 +140,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains Boolean interface, else return false ' */ -function RBS_CMN_IsBoolean(value ) as boolean +function RBS_CMN_IsBoolean(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifBoolean") <> invalid end function @@ -152,7 +152,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value type equals Integer, else return false ' */ -function RBS_CMN_IsInteger(value ) as boolean +function RBS_CMN_IsInteger(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifInt") <> invalid and (Type(value) = "roInt" or Type(value) = "roInteger" or Type(value) = "Integer") end function @@ -164,7 +164,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains Float interface, else return false ' */ -function RBS_CMN_IsFloat(value ) as boolean +function RBS_CMN_IsFloat(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifFloat") <> invalid end function @@ -176,7 +176,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains Double interface, else return false ' */ -function RBS_CMN_IsDouble(value ) as boolean +function RBS_CMN_IsDouble(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifDouble") <> invalid end function @@ -188,7 +188,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains LongInteger interface, else return false ' */ -function RBS_CMN_IsLongInteger(value ) as boolean +function RBS_CMN_IsLongInteger(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifLongInt") <> invalid end function @@ -200,7 +200,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value is number, else return false ' */ -function RBS_CMN_IsNumber(value ) as boolean +function RBS_CMN_IsNumber(value) as boolean return RBS_CMN_IsLongInteger(value) or RBS_CMN_IsDouble(value) or RBS_CMN_IsInteger(value) or RBS_CMN_IsFloat(value) end function @@ -212,7 +212,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains List interface, else return false ' */ -function RBS_CMN_IsList(value ) as boolean +function RBS_CMN_IsList(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifList") <> invalid end function @@ -224,7 +224,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains Array interface, else return false ' */ -function RBS_CMN_IsArray(value ) as boolean +function RBS_CMN_IsArray(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifArray") <> invalid end function @@ -236,7 +236,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains AssociativeArray interface, else return false ' */ -function RBS_CMN_IsAssociativeArray(value ) as boolean +function RBS_CMN_IsAssociativeArray(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifAssociativeArray") <> invalid end function @@ -248,7 +248,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains SGNodeChildren interface, else return false ' */ -function RBS_CMN_IsSGNode(value ) as boolean +function RBS_CMN_IsSGNode(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifSGNodeChildren") <> invalid end function @@ -260,7 +260,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains String interface, else return false ' */ -function RBS_CMN_IsString(value ) as boolean +function RBS_CMN_IsString(value) as boolean return RBS_CMN_IsValid(value) and GetInterface(value, "ifString") <> invalid end function @@ -272,7 +272,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains String interface and length more 0, else return false ' */ -function RBS_CMN_IsNotEmptyString(value ) as boolean +function RBS_CMN_IsNotEmptyString(value) as boolean return RBS_CMN_IsString(value) and len(value) > 0 end function @@ -284,7 +284,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value contains DateTime interface, else return false ' */ -function RBS_CMN_IsDateTime(value ) as boolean +function RBS_CMN_IsDateTime(value) as boolean return RBS_CMN_IsValid(value) and (GetInterface(value, "ifDateTime") <> invalid or Type(value) = "roDateTime") end function @@ -296,11 +296,11 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value initialized and not equal invalid, else return false ' */ -function RBS_CMN_IsValid(value ) as boolean +function RBS_CMN_IsValid(value) as boolean return not RBS_CMN_IsUndefined(value) and value <> invalid end function -function RBS_CMN_IsUndefined(value ) as boolean +function RBS_CMN_IsUndefined(value) as boolean return type(value) = "" or Type(value) = "<uninitialized>" end function @@ -312,7 +312,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {String} - value if his contains String interface else return empty string ' */ -function RBS_CMN_ValidStr(obj ) as string +function RBS_CMN_ValidStr(obj) as string if obj <> invalid and GetInterface(obj, "ifString") <> invalid return obj else @@ -328,7 +328,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} input - value to check ' * @returns {String} - converted string ' */ -function RBS_CMN_AsString(input ) as string +function RBS_CMN_AsString(input) as string if RBS_CMN_IsValid(input) = false return "" else if RBS_CMN_IsString(input) @@ -338,7 +338,7 @@

Rooibos_CommonUtils.brs

else if RBS_CMN_IsFloat(input) or RBS_CMN_IsDouble(input) return Str(input).Trim() else if type(input) = "roSGNode" - return "Node(" + input.subType() +")" + return "Node(" + input.subType() + ")" else if type(input) = "roAssociativeArray" isFirst = true text = "{" @@ -366,7 +366,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} input - value to check ' * @returns {Integer} - converted Integer ' */ -function RBS_CMN_AsInteger(input ) as integer +function RBS_CMN_AsInteger(input) as integer if RBS_CMN_IsValid(input) = false return 0 else if RBS_CMN_IsString(input) @@ -388,7 +388,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} input - value to check ' * @returns {Integer} - converted LongInteger ' */ -function RBS_CMN_AsLongInteger(input ) as longinteger +function RBS_CMN_AsLongInteger(input) as longinteger if RBS_CMN_IsValid(input) = false return 0 else if RBS_CMN_IsString(input) @@ -408,7 +408,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} input - value to check ' * @returns {Float} - converted Float ' */ -function RBS_CMN_AsFloat(input ) as float +function RBS_CMN_AsFloat(input) as float if RBS_CMN_IsValid(input) = false return 0.0 else if RBS_CMN_IsString(input) @@ -430,7 +430,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} input - value to check ' * @returns {Float} - converted Double ' */ -function RBS_CMN_AsDouble(input ) as double +function RBS_CMN_AsDouble(input) as double if RBS_CMN_IsValid(input) = false return 0.0 else if RBS_CMN_IsString(input) @@ -450,7 +450,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} input - value to check ' * @returns {Boolean} - converted boolean ' */ -function RBS_CMN_AsBoolean(input ) as boolean +function RBS_CMN_AsBoolean(input) as boolean if RBS_CMN_IsValid(input) = false return false else if RBS_CMN_IsString(input) @@ -472,7 +472,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Array} - converted array ' */ -function RBS_CMN_AsArray(value ) as object +function RBS_CMN_AsArray(value) as object if RBS_CMN_IsValid(value) if not RBS_CMN_IsArray(value) return [value] @@ -495,7 +495,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - value to check ' * @returns {Boolean} - true if value is null or empty string, else return false ' */ -function RBS_CMN_IsNullOrEmpty(value ) as boolean +function RBS_CMN_IsNullOrEmpty(value) as boolean if RBS_CMN_IsString(value) return Len(value) = 0 else @@ -518,19 +518,19 @@

Rooibos_CommonUtils.brs

' * @param {Boolean} caseSensitive - indicates if comparisons are case sensitive ' * @returns {Integer} - element index if array contains a value, else return -1 ' */ -function RBS_CMN_FindElementIndexInArray(array , value , compareAttribute = invalid , caseSensitive = false ) as integer +function RBS_CMN_FindElementIndexInArray(array , value , compareAttribute = invalid , caseSensitive = false) as integer if RBS_CMN_IsArray(array) for i = 0 to RBS_CMN_AsArray(array).Count() - 1 compareValue = array[i] - + if compareAttribute <> invalid and RBS_CMN_IsAssociativeArray(compareValue) compareValue = compareValue.LookupCI(compareAttribute) end if - + if RBS_BTS_EqValues(compareValue, value) return i end if - + item = array[i] next end if @@ -547,7 +547,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} compareAttribute - attribute to compare on ' * @returns {Boolean} - true if array contains a value, else return false ' */ -function RBS_CMN_ArrayContains(array , value , compareAttribute = invalid ) as boolean +function RBS_CMN_ArrayContains(array , value , compareAttribute = invalid) as boolean return (RBS_CMN_FindElementIndexInArray(array, value, compareAttribute) > -1) end function @@ -565,7 +565,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - child to search for ' * @returns {Integer} - element index if node contains a value, else return -1 ' */ -function RBS_CMN_FindElementIndexInNode(node , value ) as integer +function RBS_CMN_FindElementIndexInNode(node , value) as integer if type(node) = "roSGNode" for i = 0 to node.getChildCount() - 1 compareValue = node.getChild(i) @@ -585,7 +585,7 @@

Rooibos_CommonUtils.brs

' * @param {Dynamic} value - child to look for ' * @returns {Boolean} - true if node contains a value, else return false ' */ -function RBS_CMN_NodeContains(node , value ) as boolean +function RBS_CMN_NodeContains(node , value) as boolean return (RBS_CMN_FindElementIndexInNode(node, value) > -1) end function @@ -600,7 +600,7 @@

Rooibos_CommonUtils.brs


diff --git a/docs/Rooibos_ItemGenerator.brs.html b/docs/Rooibos_ItemGenerator.brs.html index 0f6fdd9a..cf9220bf 100644 --- a/docs/Rooibos_ItemGenerator.brs.html +++ b/docs/Rooibos_ItemGenerator.brs.html @@ -273,7 +273,7 @@

Rooibos_ItemGenerator.brs


diff --git a/docs/Rooibos_TestRunner.brs.html b/docs/Rooibos_TestRunner.brs.html index b2c66149..c939967d 100644 --- a/docs/Rooibos_TestRunner.brs.html +++ b/docs/Rooibos_TestRunner.brs.html @@ -56,6 +56,7 @@

Rooibos_TestRunner.brs

this = {} this.testScene = args.testScene this.nodeContext = args.nodeContext + config = RBSFM_getRuntimeConfig() if (config = invalid or not RBS_CMN_IsAssociativeArray(config)) ? "WARNING : specified config is invalid - using default" @@ -414,7 +415,7 @@

Rooibos_TestRunner.brs


diff --git a/docs/index.html b/docs/index.html index 908aed97..379c42b4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -57,7 +57,7 @@
diff --git a/docs/index.md b/docs/index.md index 894f4b87..5131e706 100644 --- a/docs/index.md +++ b/docs/index.md @@ -171,10 +171,10 @@ There are two ways to invoke rooibos-cli: ``` rooibos-cli r -p ./ -t source/tests ``` + ### Description of rooibos-cli commands -``` | flag | argument | Fescription | |--- |--- |:-: | @@ -1039,7 +1039,7 @@ end function -Rooibos is nbackward compatible with the [legacy framework](https://github.com/rokudev/unit-testing-framework/), Use the `-l --legacySupport` flag with rooibos-cli to use this feature. +Rooibos is backward compatible with the [legacy framework](https://github.com/rokudev/unit-testing-framework/), Use the `-l --legacySupport` flag with rooibos-cli to use this feature. `'@Only`, `'@Ingore`, `'@Setup`, `'@TearDown` are all supported. Only and Ignore can be applied to a whole test suite, or individual test cases. diff --git a/docs/module-BaseTestSuite.html b/docs/module-BaseTestSuite.html index 139c8c28..ed0ef5fa 100644 --- a/docs/module-BaseTestSuite.html +++ b/docs/module-BaseTestSuite.html @@ -12420,7 +12420,7 @@
Returns:

diff --git a/docs/module-CommonUtils.html b/docs/module-CommonUtils.html index f7f5b8c3..a549d5f1 100644 --- a/docs/module-CommonUtils.html +++ b/docs/module-CommonUtils.html @@ -5062,7 +5062,7 @@
Returns:

diff --git a/docs/module-ItemGenerator.html b/docs/module-ItemGenerator.html index 73ebdfdd..fa73fc63 100644 --- a/docs/module-ItemGenerator.html +++ b/docs/module-ItemGenerator.html @@ -1442,7 +1442,7 @@
Returns:

diff --git a/docs/module-TestRunner.html b/docs/module-TestRunner.html index f6039f5e..d8593df2 100644 --- a/docs/module-TestRunner.html +++ b/docs/module-TestRunner.html @@ -651,7 +651,7 @@

Run
- Generated by JSDoc 3.5.5 on Tue Jun 04 2019 20:26:45 GMT-0500 (-05) using the Minami theme. + Generated by JSDoc 3.5.5 on Sun Aug 04 2019 08:33:57 GMT-0500 (-05) using the Minami theme.
diff --git a/docs/module-rooibosh.html b/docs/module-rooibosh.html index 24c57c06..f7b2f724 100644 --- a/docs/module-rooibosh.html +++ b/docs/module-rooibosh.html @@ -294,7 +294,7 @@
Parameters:

- Generated by JSDoc 3.5.5 on Tue Jun 04 2019 20:26:45 GMT-0500 (-05) using the Minami theme. + Generated by JSDoc 3.5.5 on Sun Aug 04 2019 08:33:57 GMT-0500 (-05) using the Minami theme.
diff --git a/docs/version.txt b/docs/version.txt new file mode 100644 index 00000000..a0cd9f0c --- /dev/null +++ b/docs/version.txt @@ -0,0 +1 @@ +3.1.0 \ No newline at end of file diff --git a/gulpfile.ts b/gulpfile.ts index 7a190e29..e3716bde 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -139,8 +139,13 @@ export function doc(cb) { return task; } +export function updateVersion(cb) { + fs.writeFileSync("docs/version.txt", pkg.version); + cb(); +} + exports.build = series(clean, createDirectories, squash, copyToSamples, copyToTests); exports.runFrameworkTests = series(exports.build, prepareFrameworkTests, zipFrameworkTests, deployFrameworkTests) exports.prePublishFrameworkTests = series(exports.build, prepareFrameworkTests) exports.prePublishFrameworkCodeCoverage = series(exports.build, prepareCodeCoverageTests) -exports.dist = series(exports.build, doc); \ No newline at end of file +exports.dist = series(exports.build, doc, updateVersion); \ No newline at end of file