diff --git a/.gitignore b/.gitignore index 90071ed0..41a6a2bc 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ local.properties #node node_modules/ frameworkTests/source/tests/rooibosDist.brs +outRun diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d28dba4..712a4219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Rooibos CHANGELOG +## 3.0.0-beta + +### Added + + - Code coverage support! + +### Changed + + - there are breaking changes in rooibos-preprocessor which, are required for code coverage. I'm keeping the major versions of rooibos and rooibos-preprocessor in sync, due to documentation, and everyone's sanity + +### Deprecated + +### Removed + +### Fixed + - #45 - crash when checking an expect param, and one of the params is a mock/stub + - #40 - can now use / in the params - much better parsing, too + ## 2.3.0 ### Added diff --git a/dist/rooibosDist.brs b/dist/rooibosDist.brs index b2ba0873..4ebede13 100644 --- a/dist/rooibosDist.brs +++ b/dist/rooibosDist.brs @@ -1,6 +1,6 @@ '/** ' * rooibos - simple, flexible, fun brightscript test framework for roku scenegraph apps -' * @version v2.3.0 +' * @version v3.0.0-beta ' * @link https://github.com/georgejecook/rooibos#readme ' * @license MIT ' */ @@ -674,13 +674,15 @@ function RBS_BTS_EqAssocArray(Value1 , Value2 ) as dynamic return false else for each k in Value1 - if not Value2.DoesExist(k) - return false - else - v1 = Value1[k] - v2 = Value2[k] - if not RBS_BTS_EqValues(v1, v2) + if k <> "__mocks" and k <> "__stubs" 'fix infinite loop/box crash when doing equals on an aa with a mock + if not Value2.DoesExist(k) return false + else + v1 = Value1[k] + v2 = Value2[k] + if not RBS_BTS_EqValues(v1, v2) + return false + end if end if end if end for @@ -2032,6 +2034,9 @@ sub RBS_TR_Run() skipSuite: end for m.logger.PrintStatistic(totalStatObj) + if RBS_CMN_IsFunction(RBS_ReportCodeCoverage) + RBS_ReportCodeCoverage() + end if RBS_TR_SendHomeKeypress() end sub sub RBS_RT_RunItGroups(metaTestSuite, totalStatObj, testUtilsDecoratorMethodName, config, runtimeConfig, nodeContext = invalid) diff --git a/docs/Rooibos.brs.html b/docs/Rooibos.brs.html index 8e38201e..32221c9e 100644 --- a/docs/Rooibos.brs.html +++ b/docs/Rooibos.brs.html @@ -126,7 +126,7 @@

Rooibos.brs


diff --git a/docs/Rooibos_BaseTestSuite.brs.html b/docs/Rooibos_BaseTestSuite.brs.html index 6d76adf4..e2c4f52d 100644 --- a/docs/Rooibos_BaseTestSuite.brs.html +++ b/docs/Rooibos_BaseTestSuite.brs.html @@ -1053,13 +1053,15 @@

Rooibos_BaseTestSuite.brs

return false else for each k in Value1 - if not Value2.DoesExist(k) - return false - else - v1 = Value1[k] - v2 = Value2[k] - if not RBS_BTS_EqValues(v1, v2) + if k <> "__mocks" and k <> "__stubs" 'fix infinite loop/box crash when doing equals on an aa with a mock + if not Value2.DoesExist(k) return false + else + v1 = Value1[k] + v2 = Value2[k] + if not RBS_BTS_EqValues(v1, v2) + return false + end if end if end if end for @@ -2003,7 +2005,7 @@

Rooibos_BaseTestSuite.brs


diff --git a/docs/Rooibos_CommonUtils.brs.html b/docs/Rooibos_CommonUtils.brs.html index 95f337bb..ab2aa2a1 100644 --- a/docs/Rooibos_CommonUtils.brs.html +++ b/docs/Rooibos_CommonUtils.brs.html @@ -598,7 +598,7 @@

Rooibos_CommonUtils.brs


diff --git a/docs/Rooibos_ItemGenerator.brs.html b/docs/Rooibos_ItemGenerator.brs.html index e3f1aae8..7345acce 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 04203113..28e60e9e 100644 --- a/docs/Rooibos_TestRunner.brs.html +++ b/docs/Rooibos_TestRunner.brs.html @@ -188,8 +188,11 @@

Rooibos_TestRunner.brs

end if skipSuite: end for - m.logger.PrintStatistic(totalStatObj) + + if RBS_CMN_IsFunction(RBS_ReportCodeCoverage) + RBS_ReportCodeCoverage() + end if RBS_TR_SendHomeKeypress() end sub @@ -292,6 +295,7 @@

Rooibos_TestRunner.brs

end if testTimer = CreateObject("roTimespan") + testCaseTimer = CreateObject("roTimespan") testStatObj = RBS_STATS_CreateTestStatistic(testCase.Name) testSuite.testCase = testCase.Func testStatObj.filePath = metaTestSuite.filePath @@ -315,6 +319,7 @@

Rooibos_TestRunner.brs

end if testCaseParams.push(paramValue) end for + testCaseTimer.mark() 'up to 6 param args supported for now if (metaTestCase.expectedNumberOfParams = 1) testSuite.testCase(testCaseParams[0]) @@ -329,8 +334,11 @@

Rooibos_TestRunner.brs

else if (metaTestCase.expectedNumberOfParams = 6) testSuite.testCase(testCaseParams[0], testCaseParams[1], testCaseParams[2], testCaseParams[3], testCaseParams[4], testCaseParams[5]) end if + metaTestCase.time = testCaseTimer.totalMilliseconds() else + testCaseTimer.mark() testSuite.testCase() + metaTestCase.time = testCaseTimer.totalMilliseconds() end if else testSuite.Fail("Could not parse args for test ") @@ -428,7 +436,7 @@

Rooibos_TestRunner.brs


diff --git a/docs/index.html b/docs/index.html index af2cd482..272be156 100644 --- a/docs/index.html +++ b/docs/index.html @@ -57,7 +57,7 @@
diff --git a/docs/index.md b/docs/index.md index 9bd0c30b..38029b9a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,6 +23,7 @@ Simple, mocha-inspired, flexible, fun Brightscript test framework for ROKU apps - [Hook into your global setup mechanisms](#hook-into-your-global-setup-mechanisms) - [Only show output for failed tests](#only-show-output-for-failed-tests) - [Easily integrate into any CI system](#easily-integrate-into-any-ci-system) + - [Generate code coverage](#generate-code-coverage) ## TABLE OF CONTENTS @@ -81,13 +82,22 @@ To get the best performance and test flexibility, rooibos leverages a typescript The following working gulpfile can be found in my [roku MVVM spike](https://github.com/georgejecook/rokuNavSpike/tree/feature/viewModels); but the process is as follows. - `npm install rooibos-preprocessor --save-dev` - - Add the following to the top of gulpfile.ts `import { RooibosProcessor } from "rooibos-preprocessor";` + - Add the following to the top of gulpfile.ts `import { RooibosProcessor, createProcessorConfig, ProcessorConfig } from 'rooibos-preprocessor';` - Create a task to process your test files, such as: ``` export async function prepareTests(cb) { await rokuDeploy.prepublishToStaging(args); - let processor = new RooibosProcessor('build/.roku-deploy-staging/source/tests', 'build/.roku-deploy-staging', 'build/.roku-deploy-staging/source/tests'); + let config = createProcessorConfig({ + "projectPath": "build" + "testsFilePattern": [ + "**/tests/**/*.brs", + "!**/rooibosDist.brs", + "!**/rooibosFunctionMap.brs", + "!**/TestsScene.brs" + ] +}); + let processor = new RooibosProcessor(config); processor.processFiles(); cb(); @@ -105,26 +115,33 @@ There are two ways to invoke RooibosC: 1. Define a config file that returns a JSON object and tell RooibosC to use that via the `-c` flag: - ```sh + ``` rooibosC -c path/to/config.json ``` _To see an example config file take a look at the [Example app](../samples/example)_
-2. Use the `-t -r -o` flags to set your paths like so: +2. Alternately, use the following flags to configure test behaviour, like so: ```sh - rooibosC -t source/tests/specs -r ./ -o source/tests/rooibos + rooibosC -p ./ -t source/tests ``` +### Description of rooibosC flags + + +| flag | argument | Fescription | +|--- |--- |:-: |--: |--- | +| `-p` | `--projectPath` | the path to the root of your project. This is used to fix the `pkg:/locations` in rooibos's output. | | +| `-t` | `--testsFilePattern` | array of globs, specifying which test files (i.e. your test _.brs_ files) to include. Relative to projectPath, relative to _"projectPath"_ | | +| `-o` | `--outputPath` | you can also specity the _"outputPath"_. This is where rooibosC will write the map file, and other files it needs which informs rooibos about your tests. It is relative to | +| `-v` | `--isRecordingCodeCoverage` | indicates that we want to generate coverage +| `-s` | `--sourceFilePattern` | array of globs, specifying which files to include/exclude in code coverage. Relative to projectPath. Required if `-v` is set. | - `-t` is the _"testPath"_ where your `.brs` test specs live - `-r` is the _"rootPath"_, i.e. the path to the root of your project. This is used to fix the `pkg:/locations` in rooibos's output. - `-o` is the _"outputPath"_. This is where rooibosC will write the map file which informs rooibos about your tests. +### Configuring Rooibos's runtime behaviour -### Configuring Rooibos Rooibos's configuration is controlled via a json config file. The default location for this file is `pkg:/source/tests/rooibos/testconfig.json`. See [Example app](../samples/example) If the no testconfig is found a default one will be used. @@ -140,6 +157,8 @@ An example config file looks like this: } ``` +_Deprecation warning: This behaviour is going to change - in future, these json settings will be merged with the preprocessor config._ + ## Creating test suites @@ -987,4 +1006,43 @@ end function Rooibos is no longer backward compatible with the [legacy framework](https://github.com/rokudev/unit-testing-framework/), since version 2.0.0. -It is recommended that you upgrade your legacy tests to the new syntax for maximum flexibility and comfort. \ No newline at end of file +It is recommended that you upgrade your legacy tests to the new syntax for maximum flexibility and comfort. + +## Generate code coverage + +Rooibos can measure and report the test coverage your unit tests are producing. + +### Code coverage recording is desctructive! + +Recording coverage means modifying your sources! you should only run the coverage on a project path pointing to a build folder _not_ your source. + +These files should be cleaned and recopied _every time you run coverage_ or you will get compile errors/other undetermined behaviour. + +### 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. An example, using a json config file is : + +``` +{ + "projectPath": "build", + "sourceFilePattern": [ + "**/*.brs", + "**/*.xml", + "!**/tests", + "!**/rLog", + "!**/rLogComponents", + "!**/rooibosDist.brs", + "!**/rooibosFunctionMap.brs", + "!**/TestsScene.brs", + "!**/ThreadUtils.brs" + ], + "testsFilePattern": [ + "**/tests/**/*.brs", + "!**/rooibosDist.brs", + "!**/rooibosFunctionMap.brs", + "!**/TestsScene.brs" + ], + "isRecordingCodeCoverage": true +}``` + +This can be done, from the command line also, with the flags: + diff --git a/docs/module-BaseTestSuite.html b/docs/module-BaseTestSuite.html index 342ea365..e2a71609 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 e329065e..bce70b71 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 6f665439..a985b6f7 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 2c6f24b3..58ae2671 100644 --- a/docs/module-TestRunner.html +++ b/docs/module-TestRunner.html @@ -651,7 +651,7 @@

Run
- Generated by JSDoc 3.5.5 on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme. + Generated by JSDoc 3.5.5 on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
diff --git a/docs/module-rooibosh.html b/docs/module-rooibosh.html index 4c2bbe11..d58659db 100644 --- a/docs/module-rooibosh.html +++ b/docs/module-rooibosh.html @@ -294,7 +294,7 @@
Parameters:

- Generated by JSDoc 3.5.5 on Fri Apr 26 2019 22:57:27 GMT-0500 (-05) using the Minami theme. + Generated by JSDoc 3.5.5 on Sat May 25 2019 22:57:12 GMT-0500 (-05) using the Minami theme.
diff --git a/frameworkTests/source/tests/BasicTests.brs b/frameworkTests/source/tests/BasicTests.brs index 22789cde..cf6564de 100644 --- a/frameworkTests/source/tests/BasicTests.brs +++ b/frameworkTests/source/tests/BasicTests.brs @@ -14,4 +14,35 @@ end function function BT_doSomethingInNodeScope(value) m._isNodeScopeVarSet = value +end function + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'@It tests aa's with a mock will not crash the box! +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +'@Test +function BT_EqualsFixForStubbedAAs() as void + aa = {"test":"value"} + m.expectOnce(aa, "getStubbedObject", [aa]) + + aa.getStubbedObject(aa) +end function + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'@It url in params +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +'@Test simple +'@Params["http://101.rooibos.com"] +function BT_urlParams(url) as void + m.assertEqual(url, "http://101.rooibos.com") +end function + +'@Test on objects +'@Params[{"url":"http://101.rooibos.com", "othervalue":2}] +'@Params[{url:"http://101.rooibos.com", "othervalue":2}] +'@Params[{url:"http://101.rooibos.com", othervalue:2}] +function BT_urlParams_objects(aa) as void + m.assertEqual(aa.url, "http://101.rooibos.com") + m.assertEqual(aa.othervalue, 2) end function \ No newline at end of file diff --git a/gulpfile.ts b/gulpfile.ts index 6c85a52c..ff03e8e5 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -1,4 +1,6 @@ import { series } from "gulp"; +import { RooibosProcessor, createProcessorConfig, ProcessorConfig } from "rooibos-preprocessor"; + const concat = require('gulp-concat'); const gulp = require('gulp'); const path = require('path'); @@ -11,7 +13,6 @@ const distFile = `rooibosDist.brs`; const fullDistPath = path.join(distDir, distFile); const fs = require('fs'); const rmLines = require('gulp-rm-lines'); -const gulpCopy = require('gulp-copy'); const rokuDeploy = require('roku-deploy'); const cp = require('child_process'); @@ -57,18 +58,68 @@ function squash() { } function copyToSamples(cb) { - fs.copyFile(fullDistPath, path.join('frameworkTests/source/tests', distFile), cb); - fs.copyFile(fullDistPath, path.join('samples/example/source/tests/rooibos', distFile), cb); + const frameworkFile = path.join('frameworkTests/source/tests', distFile); + const sampleFile = path.join('samples/example/source/tests/rooibos', distFile); + if (fs.existsSync(frameworkFile)) { + fs.unlinkSync(frameworkFile); + } + if (fs.existsSync(sampleFile)) { + fs.unlinkSync(sampleFile); + } + fs.copyFileSync(fullDistPath, frameworkFile); + fs.copyFileSync(fullDistPath, sampleFile); + cb(); } /** * This target is used for CI */ -export function prepareFrameworkTests(cb) { - rokuDeploy.prepublishToStaging(args); - let task = cp.exec('rooibosC -t out/.roku-deploy-staging/source/tests -r out/.roku-deploy-staging'); - task.stdout.pipe(process.stdout) - return task; +export async function prepareFrameworkTests(cb) { + await rokuDeploy.prepublishToStaging(args); + + let config = createProcessorConfig({ + "projectPath": "out/.roku-deploy-staging", + "testsFilePattern": [ + "**/tests/**/*.brs", + "!**/rooibosDist.brs", + "!**/rooibosFunctionMap.brs", + "!**/TestsScene.brs" + ] + }); + let processor = new RooibosProcessor(config); + processor.processFiles(); + + cb(); +} + +export async function prepareCodeCoverageTests(cb) { + await rokuDeploy.prepublishToStaging(args); + + let config = createProcessorConfig({ + "projectPath": "out/.roku-deploy-staging", + "testsFilePattern": [ + "**/tests/**/*.brs", + "!**/rooibosDist.brs", + "!**/rooibosFunctionMap.brs", + "!**/TestsScene.brs" + ], + "sourceFilePattern": [ + "**/*.brs", + "**/*.xml", + "!**/tests", + "!**/rLog", + "!**/rLogComponents", + "!**/rooibosDist.brs", + "!**/rooibosFunctionMap.brs", + "!**/TestsScene.brs", + "!**/ThreadUtils.brs" + ], + "isRecordingCodeCoverage": true + }); + let processor = new RooibosProcessor(config); + processor.processFiles(); + + cb(); } export async function zipFrameworkTests(cb) { @@ -87,4 +138,5 @@ export function doc(cb) { exports.build = series(clean, createDirectories, squash, copyToSamples); 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 diff --git a/outRun/.roku-deploy-staging/source/main.brs b/outRun/.roku-deploy-staging/source/main.brs index c7639c93..1411f3f9 100644 --- a/outRun/.roku-deploy-staging/source/main.brs +++ b/outRun/.roku-deploy-staging/source/main.brs @@ -1,30 +1,30 @@ sub Main(args as dynamic) - if (type(Rooibos__Init) = "Function") then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m) + if RBS_CC_1_reportLine(1, 2) and ((type(Rooibos__Init) = "Function")) then Rooibos__Init(SetupGlobals, "AddTestUtils", invalid, m) - InitScreen() +RBS_CC_1_reportLine(3, 1): 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) +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) - rootScene = screen.CreateScene("TestsScene") - rootScene.id = "ROOT" +RBS_CC_1_reportLine(13, 1): rootScene = screen.CreateScene("TestsScene") +RBS_CC_1_reportLine(14, 1): rootScene.id = "ROOT" - screen.show() +RBS_CC_1_reportLine(16, 1): screen.show() - SetupGlobals(screen) +RBS_CC_1_reportLine(18, 1): SetupGlobals(screen) - while(true) - msg = wait(0, m.port) - msgType = type(msg) +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) - if msgType = "roSGScreenEvent" - if msg.isScreenClosed() - return + 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 end if end if end while @@ -36,13 +36,13 @@ end function '** @param screen as roScreen - screen to set globals on '************************************************************* function SetupGlobals(screen) as void - ? "SETTTING UP GLOBALS - do your standard setup stuff here" +RBS_CC_1_reportLine(38, 1): ? "SETTTING UP GLOBALS - do your standard setup stuff here" - m.global = screen.getGlobalNode() +RBS_CC_1_reportLine(40, 1): m.global = screen.getGlobalNode() - m.roDeviceInfo = CreateObject("roDeviceInfo") +RBS_CC_1_reportLine(42, 1): m.roDeviceInfo = CreateObject("roDeviceInfo") - m.displayInfo = { +RBS_CC_1_reportLine(44, 1): m.displayInfo = { resolution: m.roDeviceInfo.GetUIResolution() displayType: m.roDeviceInfo.GetDisplayType() width: m.roDeviceInfo.GetDisplaySize().w @@ -51,7 +51,34 @@ function SetupGlobals(screen) as void hFactor: m.roDeviceInfo.GetDisplaySize().h/1080 } - m.modelLocator = {"displayInfo":m.displayInfo} ' contrived example : this would be a specifc modelLocator node/other setup thing +RBS_CC_1_reportLine(53, 1): m.modelLocator = {"displayInfo":m.displayInfo} ' contrived example : this would be a specifc modelLocator node/other setup thing - m.global.addFields({"modelLocator": m.modelLocator}) +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 end function diff --git a/outRun/.roku-deploy-staging/source/tests/AssertionTests.brs b/outRun/.roku-deploy-staging/source/tests/AssertionTests.brs index 6eba2846..65df2f69 100644 --- a/outRun/.roku-deploy-staging/source/tests/AssertionTests.brs +++ b/outRun/.roku-deploy-staging/source/tests/AssertionTests.brs @@ -7,13 +7,13 @@ '@Test Fail function Simp_basic_Fail() as void - assertResult = m.Fail("reason") +RBS_CC_2_reportLine(9, 1): assertResult = m.Fail("reason") - isFail = m.currentResult.isFail - m.currentResult.Reset() +RBS_CC_2_reportLine(11, 1): isFail = m.currentResult.isFail +RBS_CC_2_reportLine(12, 1): m.currentResult.Reset() - m.AssertFalse(assertResult) - m.AssertTrue(isFail) +RBS_CC_2_reportLine(14, 1): m.AssertFalse(assertResult) +RBS_CC_2_reportLine(15, 1): m.AssertTrue(isFail) end function '@Test AssertTrue @@ -25,12 +25,12 @@ end function '@Params["test", false] function Simp_basic_AssertTrue(value, expectedAssertResult) as void - assertResult = m.AssertTrue(value) - isFail = m.currentResult.isFail - m.currentResult.Reset() +RBS_CC_2_reportLine(27, 1): assertResult = m.AssertTrue(value) +RBS_CC_2_reportLine(28, 1): isFail = m.currentResult.isFail +RBS_CC_2_reportLine(29, 1): m.currentResult.Reset() - m.AssertEqual(assertResult, expectedAssertResult) - m.AssertEqual(isFail, not expectedAssertResult) +RBS_CC_2_reportLine(31, 1): m.AssertEqual(assertResult, expectedAssertResult) +RBS_CC_2_reportLine(32, 1): m.AssertEqual(isFail, not expectedAssertResult) end function '@Test AssertFalse @@ -42,13 +42,13 @@ end function '@Params["test", false] function Simp_basic_AssertFalse(value, expectedAssertResult) as void - assertResult = m.AssertFalse(value) +RBS_CC_2_reportLine(44, 1): assertResult = m.AssertFalse(value) - isFail = m.currentResult.isFail - m.currentResult.Reset() +RBS_CC_2_reportLine(46, 1): isFail = m.currentResult.isFail +RBS_CC_2_reportLine(47, 1): m.currentResult.Reset() - m.AssertEqual(assertResult, expectedAssertResult) - m.AssertEqual(isFail, not expectedAssertResult) +RBS_CC_2_reportLine(49, 1): m.AssertEqual(assertResult, expectedAssertResult) +RBS_CC_2_reportLine(50, 1): m.AssertEqual(isFail, not expectedAssertResult) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -74,13 +74,13 @@ end function '@Params[[{"one":1}, {"two":2}], [{"a":1}, {"a":1}, {"a":1}] ] function Simp_AssertArrayContainsAAs_Fail(expectedAAs, items) as void - assertResult = m.AssertArrayContainsAAs(items, expectedAAs) +RBS_CC_2_reportLine(76, 1): assertResult = m.AssertArrayContainsAAs(items, expectedAAs) - isFail = m.currentResult.isFail - m.currentResult.Reset() +RBS_CC_2_reportLine(78, 1): isFail = m.currentResult.isFail +RBS_CC_2_reportLine(79, 1): m.currentResult.Reset() - m.AssertFalse(assertResult) - m.AssertTrue(isFail) +RBS_CC_2_reportLine(81, 1): m.AssertFalse(assertResult) +RBS_CC_2_reportLine(82, 1): m.AssertTrue(isFail) end function @@ -94,13 +94,13 @@ end function '@Params[[{"one":1, "two":2}, {"one":1}, {"three":3}], [{"one":1}, {"three":3}, { "two":2, "one":1}]] function Simp_AssertArrayContainsAAs_Pass(expectedAAs, items) as void - assertResult = m.AssertArrayContainsAAs(items, expectedAAs) +RBS_CC_2_reportLine(96, 1): assertResult = m.AssertArrayContainsAAs(items, expectedAAs) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(98, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertTrue(assertResult) - m.AssertFalse(isFail) +RBS_CC_2_reportLine(100, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(101, 1): m.AssertTrue(assertResult) +RBS_CC_2_reportLine(102, 1): m.AssertFalse(isFail) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -109,24 +109,24 @@ end function '@BeforeEach function Simp_AssertGlobal_beforeEach() as void - m.beforeEachGlobal = m.global +RBS_CC_2_reportLine(111, 1): m.beforeEachGlobal = m.global end function '@AfterEach function Simp_AssertGlobal_afterEach() as void - m.afterEachGlobal = m.global +RBS_CC_2_reportLine(116, 1): m.afterEachGlobal = m.global end function '@Test global is in test function Simp_AssertGlobalIsPassedIntoTest() as void - m.AssertNotInvalid(m.global) +RBS_CC_2_reportLine(121, 1): m.AssertNotInvalid(m.global) end function '@Test global is in before each and after each function Simp_AssertGlobalIsPassedInto_beforeEach_and_afterEach() as void - m.AssertNotInvalid(m.global) - m.AssertNotInvalid(m.beforeEachGlobal) - m.AssertNotInvalid(m.afterEachGlobal) +RBS_CC_2_reportLine(126, 1): m.AssertNotInvalid(m.global) +RBS_CC_2_reportLine(127, 1): m.AssertNotInvalid(m.beforeEachGlobal) +RBS_CC_2_reportLine(128, 1): m.AssertNotInvalid(m.afterEachGlobal) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -141,12 +141,12 @@ end function '@Params[[{"test":1}, {"test":1}], "AssociativeArray"] function Simp_AssertArrayContainsOnlyValuesOfType_Pass(values, typeName) as void - assertResult = m.AssertArrayContainsOnlyValuesOfType(values, typeName) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(143, 1): assertResult = m.AssertArrayContainsOnlyValuesOfType(values, typeName) +RBS_CC_2_reportLine(144, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertTrue(assertResult) - m.AssertFalse(isFail) +RBS_CC_2_reportLine(146, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(147, 1): m.AssertTrue(assertResult) +RBS_CC_2_reportLine(148, 1): m.AssertFalse(isFail) end function @@ -164,14 +164,14 @@ end function '@Params[[{"test":1}, {"test":1}], "Array"] function Simp_AssertArrayContainsOnlyValuesOfType_Fail(values, typeName) as void - assertResult = m.AssertArrayContainsOnlyValuesOfType(values, typeName) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(166, 1): assertResult = m.AssertArrayContainsOnlyValuesOfType(values, typeName) +RBS_CC_2_reportLine(167, 1): isFail = m.currentResult.isFail - isFail = m.currentResult.isFail - m.currentResult.Reset() +RBS_CC_2_reportLine(169, 1): isFail = m.currentResult.isFail +RBS_CC_2_reportLine(170, 1): m.currentResult.Reset() - m.AssertFalse(assertResult) - m.AssertTrue(isFail) +RBS_CC_2_reportLine(172, 1): m.AssertFalse(assertResult) +RBS_CC_2_reportLine(173, 1): m.AssertTrue(isFail) end function @@ -186,7 +186,7 @@ end function 'that we can have comments 'between functions and tags function Simp_whiteSpacing() as void - m.AssertTrue(true) +RBS_CC_2_reportLine(188, 1): m.AssertTrue(true) end function 'some comments to @@ -201,7 +201,7 @@ end function '@Params[4] function Simp_whiteSpacing_params(value) as void - m.AssertTrue(true) +RBS_CC_2_reportLine(203, 1): m.AssertTrue(true) end function @@ -224,8 +224,8 @@ end function '@Params[[3, 2, 1], [1, 2, 3], false] function Simp_EqArray_Pass(values, values2, expected) as void - result = m.EqArray(values, values2) - m.AssertEqual(result, expected) +RBS_CC_2_reportLine(226, 1): result = m.EqArray(values, values2) +RBS_CC_2_reportLine(227, 1): m.AssertEqual(result, expected) end function @@ -243,12 +243,12 @@ end function '@Params[[invalid]] function Simp_AssertNotEmpty_Pass(values) as void - assertResult = m.AssertNotEmpty(values) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(245, 1): assertResult = m.AssertNotEmpty(values) +RBS_CC_2_reportLine(246, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertTrue(assertResult) - m.AssertFalse(isFail) +RBS_CC_2_reportLine(248, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(249, 1): m.AssertTrue(assertResult) +RBS_CC_2_reportLine(250, 1): m.AssertFalse(isFail) end function @@ -260,12 +260,12 @@ end function '@Params[""] function Simp_AssertNotEmpty_Fail(values) as void - assertResult = m.AssertNotEmpty(values) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(262, 1): assertResult = m.AssertNotEmpty(values) +RBS_CC_2_reportLine(263, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(assertResult) - m.AssertTrue(isFail) +RBS_CC_2_reportLine(265, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(266, 1): m.AssertFalse(assertResult) +RBS_CC_2_reportLine(267, 1): m.AssertTrue(isFail) end function @@ -279,12 +279,12 @@ end function '@Params[""] function Simp_AssertEmpty_Pass(values) as void - assertResult = m.AssertEmpty(values) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(281, 1): assertResult = m.AssertEmpty(values) +RBS_CC_2_reportLine(282, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertTrue(assertResult) - m.AssertFalse(isFail) +RBS_CC_2_reportLine(284, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(285, 1): m.AssertTrue(assertResult) +RBS_CC_2_reportLine(286, 1): m.AssertFalse(isFail) end function @@ -300,12 +300,12 @@ end function '@Params[[invalid]] function Simp_AssertEmpty_Fail(values) as void - assertResult = m.AssertEmpty(values) - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(302, 1): assertResult = m.AssertEmpty(values) +RBS_CC_2_reportLine(303, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(assertResult) - m.AssertTrue(isFail) +RBS_CC_2_reportLine(305, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(306, 1): m.AssertFalse(assertResult) +RBS_CC_2_reportLine(307, 1): m.AssertTrue(isFail) end function @@ -315,29 +315,29 @@ end function '@Test multi return values function Simp_expect_multiValues() - obj = {} - m.expect(obj, "mockMethod", 5, invalid, {"multiResult": ["one", 2, invalid, "last"]}, true) +RBS_CC_2_reportLine(317, 1): obj = {} +RBS_CC_2_reportLine(318, 1): m.expect(obj, "mockMethod", 5, invalid, {"multiResult": ["one", 2, invalid, "last"]}, true) - result = obj.mockMethod() - m.AssertEqual(result, "one") +RBS_CC_2_reportLine(320, 1): result = obj.mockMethod() +RBS_CC_2_reportLine(321, 1): m.AssertEqual(result, "one") - result = obj.mockMethod() - m.AssertEqual(result, 2) +RBS_CC_2_reportLine(323, 1): result = obj.mockMethod() +RBS_CC_2_reportLine(324, 1): m.AssertEqual(result, 2) - result = obj.mockMethod() - m.AssertEqual(result, invalid) +RBS_CC_2_reportLine(326, 1): result = obj.mockMethod() +RBS_CC_2_reportLine(327, 1): m.AssertEqual(result, invalid) - result = obj.mockMethod() - m.AssertEqual(result, "last") +RBS_CC_2_reportLine(329, 1): result = obj.mockMethod() +RBS_CC_2_reportLine(330, 1): m.AssertEqual(result, "last") - result = obj.mockMethod() - m.AssertEqual(result, "last") +RBS_CC_2_reportLine(332, 1): result = obj.mockMethod() +RBS_CC_2_reportLine(333, 1): m.AssertEqual(result, "last") - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(335, 1): m.assertMocks() +RBS_CC_2_reportLine(336, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(338, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(339, 1): m.AssertFalse(isFail) end function @@ -347,172 +347,172 @@ end function '@Test simple test function Simp_expect_multiExpect_success() - obj = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(349, 1): obj = {} +RBS_CC_2_reportLine(350, 1): arg1 = "arg1" +RBS_CC_2_reportLine(351, 1): arg2 = "arg2" +RBS_CC_2_reportLine(352, 1): arg3 = "arg3" +RBS_CC_2_reportLine(353, 1): result1 = 1 +RBS_CC_2_reportLine(354, 1): result2 = 2 +RBS_CC_2_reportLine(355, 1): result3 = 3 - m.expectOnce(obj, "mockMethod", [arg1], result1, true) - m.expectOnce(obj, "mockMethod", [arg2], result2, true) - m.expectOnce(obj, "mockMethod", [arg3], result3, true) +RBS_CC_2_reportLine(357, 1): m.expectOnce(obj, "mockMethod", [arg1], result1, true) +RBS_CC_2_reportLine(358, 1): m.expectOnce(obj, "mockMethod", [arg2], result2, true) +RBS_CC_2_reportLine(359, 1): m.expectOnce(obj, "mockMethod", [arg3], result3, true) - result = obj.mockMethod(arg1) - m.AssertEqual(result, result1) +RBS_CC_2_reportLine(361, 1): result = obj.mockMethod(arg1) +RBS_CC_2_reportLine(362, 1): m.AssertEqual(result, result1) - result = obj.mockMethod(arg2) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(364, 1): result = obj.mockMethod(arg2) +RBS_CC_2_reportLine(365, 1): m.AssertEqual(result, result2) - result = obj.mockMethod(arg3) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(367, 1): result = obj.mockMethod(arg3) +RBS_CC_2_reportLine(368, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(370, 1): m.assertMocks() +RBS_CC_2_reportLine(371, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(373, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(374, 1): m.AssertFalse(isFail) end function '@Test can set up multi expects on same method - one invocation with any args function Simp_expect_multiExpect_success_oneCallsArgsNotTracked() - obj = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(380, 1): obj = {} +RBS_CC_2_reportLine(381, 1): arg1 = "arg1" +RBS_CC_2_reportLine(382, 1): arg2 = "arg2" +RBS_CC_2_reportLine(383, 1): arg3 = "arg3" +RBS_CC_2_reportLine(384, 1): result1 = 1 +RBS_CC_2_reportLine(385, 1): result2 = 2 +RBS_CC_2_reportLine(386, 1): result3 = 3 - m.expectOnce(obj, "mockMethod", [arg1], result1, true) - m.expectOnce(obj, "mockMethod", invalid, result2, true) - m.expectOnce(obj, "mockMethod", [arg3], result3, true) +RBS_CC_2_reportLine(388, 1): m.expectOnce(obj, "mockMethod", [arg1], result1, true) +RBS_CC_2_reportLine(389, 1): m.expectOnce(obj, "mockMethod", invalid, result2, true) +RBS_CC_2_reportLine(390, 1): m.expectOnce(obj, "mockMethod", [arg3], result3, true) - result = obj.mockMethod(arg1) - m.AssertEqual(result, result1) +RBS_CC_2_reportLine(392, 1): result = obj.mockMethod(arg1) +RBS_CC_2_reportLine(393, 1): m.AssertEqual(result, result1) - result = obj.mockMethod("do not care about args", "used in invocation", 2) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(395, 1): result = obj.mockMethod("do not care about args", "used in invocation", 2) +RBS_CC_2_reportLine(396, 1): m.AssertEqual(result, result2) - result = obj.mockMethod(arg3) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(398, 1): result = obj.mockMethod(arg3) +RBS_CC_2_reportLine(399, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(401, 1): m.assertMocks() +RBS_CC_2_reportLine(402, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(404, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(405, 1): m.AssertFalse(isFail) end function '@Test can set up multi expects on same method - multi params function Simp_expect_multiExpect_multi_args_success() - obj = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(411, 1): obj = {} +RBS_CC_2_reportLine(412, 1): arg1 = "arg1" +RBS_CC_2_reportLine(413, 1): arg2 = "arg2" +RBS_CC_2_reportLine(414, 1): arg3 = "arg3" +RBS_CC_2_reportLine(415, 1): result1 = 1 +RBS_CC_2_reportLine(416, 1): result2 = 2 +RBS_CC_2_reportLine(417, 1): result3 = 3 - m.expectOnce(obj, "mockMethod", [arg1, arg2, arg3], result1, true) - m.expectOnce(obj, "mockMethod", [arg2, arg3, arg1], result2, true) - m.expectOnce(obj, "mockMethod", [arg3, arg2, arg1], result3, true) +RBS_CC_2_reportLine(419, 1): m.expectOnce(obj, "mockMethod", [arg1, arg2, arg3], result1, true) +RBS_CC_2_reportLine(420, 1): m.expectOnce(obj, "mockMethod", [arg2, arg3, arg1], result2, true) +RBS_CC_2_reportLine(421, 1): m.expectOnce(obj, "mockMethod", [arg3, arg2, arg1], result3, true) - result = obj.mockMethod(arg1, arg2, arg3) - m.AssertEqual(result, result1) +RBS_CC_2_reportLine(423, 1): result = obj.mockMethod(arg1, arg2, arg3) +RBS_CC_2_reportLine(424, 1): m.AssertEqual(result, result1) - result = obj.mockMethod(arg2, arg3, arg1) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(426, 1): result = obj.mockMethod(arg2, arg3, arg1) +RBS_CC_2_reportLine(427, 1): m.AssertEqual(result, result2) - result = obj.mockMethod(arg3, arg2, arg1) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(429, 1): result = obj.mockMethod(arg3, arg2, arg1) +RBS_CC_2_reportLine(430, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(432, 1): m.assertMocks() +RBS_CC_2_reportLine(433, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(435, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(436, 1): m.AssertFalse(isFail) end function '@Test multi test, multi params with other expects function Simp_expect_multiExpect_multi_args_others_success() - obj = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(442, 1): obj = {} +RBS_CC_2_reportLine(443, 1): arg1 = "arg1" +RBS_CC_2_reportLine(444, 1): arg2 = "arg2" +RBS_CC_2_reportLine(445, 1): arg3 = "arg3" +RBS_CC_2_reportLine(446, 1): result1 = 1 +RBS_CC_2_reportLine(447, 1): result2 = 2 +RBS_CC_2_reportLine(448, 1): result3 = 3 - m.expectOnce(obj, "anotherMockMethod", invalid, "another", true) - m.expectOnce(obj, "anotherMockMethod2", [1,2,3], "another2", true) - m.expectOnce(obj, "mockMethod", [arg1, arg2, arg3], result1, true) - m.expectOnce(obj, "mockMethod", [arg2, arg3, arg1], result2, true) - m.expectOnce(obj, "mockMethod", [arg3, arg2, arg1], result3, true) +RBS_CC_2_reportLine(450, 1): m.expectOnce(obj, "anotherMockMethod", invalid, "another", true) +RBS_CC_2_reportLine(451, 1): m.expectOnce(obj, "anotherMockMethod2", [1,2,3], "another2", true) +RBS_CC_2_reportLine(452, 1): m.expectOnce(obj, "mockMethod", [arg1, arg2, arg3], result1, true) +RBS_CC_2_reportLine(453, 1): m.expectOnce(obj, "mockMethod", [arg2, arg3, arg1], result2, true) +RBS_CC_2_reportLine(454, 1): m.expectOnce(obj, "mockMethod", [arg3, arg2, arg1], result3, true) - result = obj.anotherMockMethod() - m.AssertEqual(result, "another") +RBS_CC_2_reportLine(456, 1): result = obj.anotherMockMethod() +RBS_CC_2_reportLine(457, 1): m.AssertEqual(result, "another") - result = obj.anotherMockMethod2(1, 2, 3) - m.AssertEqual(result, "another2") +RBS_CC_2_reportLine(459, 1): result = obj.anotherMockMethod2(1, 2, 3) +RBS_CC_2_reportLine(460, 1): m.AssertEqual(result, "another2") - result = obj.mockMethod(arg1, arg2, arg3) - m.AssertEqual(result, result) +RBS_CC_2_reportLine(462, 1): result = obj.mockMethod(arg1, arg2, arg3) +RBS_CC_2_reportLine(463, 1): m.AssertEqual(result, result) - result = obj.mockMethod(arg2, arg3, arg1) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(465, 1): result = obj.mockMethod(arg2, arg3, arg1) +RBS_CC_2_reportLine(466, 1): m.AssertEqual(result, result2) - result = obj.mockMethod(arg3, arg2, arg1) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(468, 1): result = obj.mockMethod(arg3, arg2, arg1) +RBS_CC_2_reportLine(469, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(471, 1): m.assertMocks() +RBS_CC_2_reportLine(472, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(474, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(475, 1): m.AssertFalse(isFail) end function '@Test multi test, multi params with other expects - fail others function Simp_expect_multiExpect_multi_args_others_fail() - obj = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(481, 1): obj = {} +RBS_CC_2_reportLine(482, 1): arg1 = "arg1" +RBS_CC_2_reportLine(483, 1): arg2 = "arg2" +RBS_CC_2_reportLine(484, 1): arg3 = "arg3" +RBS_CC_2_reportLine(485, 1): result1 = 1 +RBS_CC_2_reportLine(486, 1): result2 = 2 +RBS_CC_2_reportLine(487, 1): result3 = 3 - m.expectOnce(obj, "anotherMockMethod", ["not passed"], "another", true) - m.expectOnce(obj, "anotherMockMethod2", [1,2,3], "another2", true) - m.expectOnce(obj, "mockMethod", [arg1, arg2, arg3], result1, true) - m.expectOnce(obj, "mockMethod", [arg2, arg3, arg1], result2, true) - m.expectOnce(obj, "mockMethod", [arg3, arg2, arg1], result3, true) +RBS_CC_2_reportLine(489, 1): m.expectOnce(obj, "anotherMockMethod", ["not passed"], "another", true) +RBS_CC_2_reportLine(490, 1): m.expectOnce(obj, "anotherMockMethod2", [1,2,3], "another2", true) +RBS_CC_2_reportLine(491, 1): m.expectOnce(obj, "mockMethod", [arg1, arg2, arg3], result1, true) +RBS_CC_2_reportLine(492, 1): m.expectOnce(obj, "mockMethod", [arg2, arg3, arg1], result2, true) +RBS_CC_2_reportLine(493, 1): m.expectOnce(obj, "mockMethod", [arg3, arg2, arg1], result3, true) - result = obj.anotherMockMethod() - m.AssertEqual(result, "another") +RBS_CC_2_reportLine(495, 1): result = obj.anotherMockMethod() +RBS_CC_2_reportLine(496, 1): m.AssertEqual(result, "another") - result = obj.anotherMockMethod2(1, 2, 3) - m.AssertEqual(result, "another2") +RBS_CC_2_reportLine(498, 1): result = obj.anotherMockMethod2(1, 2, 3) +RBS_CC_2_reportLine(499, 1): m.AssertEqual(result, "another2") - result = obj.mockMethod(arg1, arg2, arg3) - m.AssertEqual(result, result) +RBS_CC_2_reportLine(501, 1): result = obj.mockMethod(arg1, arg2, arg3) +RBS_CC_2_reportLine(502, 1): m.AssertEqual(result, result) - result = obj.mockMethod(arg2, arg3, arg1) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(504, 1): result = obj.mockMethod(arg2, arg3, arg1) +RBS_CC_2_reportLine(505, 1): m.AssertEqual(result, result2) - result = obj.mockMethod(arg3, arg2, arg1) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(507, 1): result = obj.mockMethod(arg3, arg2, arg1) +RBS_CC_2_reportLine(508, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(510, 1): m.assertMocks() +RBS_CC_2_reportLine(511, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertTrue(isFail) +RBS_CC_2_reportLine(513, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(514, 1): m.AssertTrue(isFail) end function @@ -524,32 +524,32 @@ end function '@Params["arg1_", "arg2_", "arg3"] '@Params["arg1_", invalid, "arg3"] function Simp_expect_multiExpect_fail(call1, call2, call3) - obj = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(526, 1): obj = {} +RBS_CC_2_reportLine(527, 1): arg1 = "arg1" +RBS_CC_2_reportLine(528, 1): arg2 = "arg2" +RBS_CC_2_reportLine(529, 1): arg3 = "arg3" +RBS_CC_2_reportLine(530, 1): result1 = 1 +RBS_CC_2_reportLine(531, 1): result2 = 2 +RBS_CC_2_reportLine(532, 1): result3 = 3 - m.expectOnce(obj, "mockMethod", [arg1], result1, true) - m.expectOnce(obj, "mockMethod", [arg2], result2, true) - m.expectOnce(obj, "mockMethod", [arg3], result3, true) +RBS_CC_2_reportLine(534, 1): m.expectOnce(obj, "mockMethod", [arg1], result1, true) +RBS_CC_2_reportLine(535, 1): m.expectOnce(obj, "mockMethod", [arg2], result2, true) +RBS_CC_2_reportLine(536, 1): m.expectOnce(obj, "mockMethod", [arg3], result3, true) - result = obj.mockMethod(call1) - m.AssertEqual(result, result1) +RBS_CC_2_reportLine(538, 1): result = obj.mockMethod(call1) +RBS_CC_2_reportLine(539, 1): m.AssertEqual(result, result1) - result = obj.mockMethod(call2) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(541, 1): result = obj.mockMethod(call2) +RBS_CC_2_reportLine(542, 1): m.AssertEqual(result, result2) - result = obj.mockMethod(call2) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(544, 1): result = obj.mockMethod(call2) +RBS_CC_2_reportLine(545, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(547, 1): m.assertMocks() +RBS_CC_2_reportLine(548, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertTrue(isFail) +RBS_CC_2_reportLine(550, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(551, 1): m.AssertTrue(isFail) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -558,65 +558,65 @@ end function '@Test success function Simp_expect_multiExpect_differentOnj_success() - obj = {} - obj2 = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(560, 1): obj = {} +RBS_CC_2_reportLine(561, 1): obj2 = {} +RBS_CC_2_reportLine(562, 1): arg1 = "arg1" +RBS_CC_2_reportLine(563, 1): arg2 = "arg2" +RBS_CC_2_reportLine(564, 1): arg3 = "arg3" +RBS_CC_2_reportLine(565, 1): result1 = 1 +RBS_CC_2_reportLine(566, 1): result2 = 2 +RBS_CC_2_reportLine(567, 1): result3 = 3 - m.expectOnce(obj, "mockMethod", [arg1], result1, true) - m.expectOnce(obj, "mockMethod", [arg2], result2, true) - m.expectOnce(obj2, "mockMethod", [arg3], result3, true) +RBS_CC_2_reportLine(569, 1): m.expectOnce(obj, "mockMethod", [arg1], result1, true) +RBS_CC_2_reportLine(570, 1): m.expectOnce(obj, "mockMethod", [arg2], result2, true) +RBS_CC_2_reportLine(571, 1): m.expectOnce(obj2, "mockMethod", [arg3], result3, true) - result = obj.mockMethod(arg1) - m.AssertEqual(result, result1) +RBS_CC_2_reportLine(573, 1): result = obj.mockMethod(arg1) +RBS_CC_2_reportLine(574, 1): m.AssertEqual(result, result1) - result = obj.mockMethod(arg2) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(576, 1): result = obj.mockMethod(arg2) +RBS_CC_2_reportLine(577, 1): m.AssertEqual(result, result2) - result = obj2.mockMethod(arg3) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(579, 1): result = obj2.mockMethod(arg3) +RBS_CC_2_reportLine(580, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(582, 1): m.assertMocks() +RBS_CC_2_reportLine(583, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(585, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(586, 1): m.AssertFalse(isFail) end function '@Test fail to match function Simp_expect_multiExpect_differentOnj_fail() - obj = {} - obj2 = {} - arg1 = "arg1" - arg2 = "arg2" - arg3 = "arg3" - result1 = 1 - result2 = 2 - result3 = 3 +RBS_CC_2_reportLine(592, 1): obj = {} +RBS_CC_2_reportLine(593, 1): obj2 = {} +RBS_CC_2_reportLine(594, 1): arg1 = "arg1" +RBS_CC_2_reportLine(595, 1): arg2 = "arg2" +RBS_CC_2_reportLine(596, 1): arg3 = "arg3" +RBS_CC_2_reportLine(597, 1): result1 = 1 +RBS_CC_2_reportLine(598, 1): result2 = 2 +RBS_CC_2_reportLine(599, 1): result3 = 3 - m.expectOnce(obj, "mockMethod", [arg1], result1, true) - m.expectOnce(obj, "mockMethod", [arg2], result2, true) - m.expectOnce(obj2, "mockMethod", [arg3], result3, true) +RBS_CC_2_reportLine(601, 1): m.expectOnce(obj, "mockMethod", [arg1], result1, true) +RBS_CC_2_reportLine(602, 1): m.expectOnce(obj, "mockMethod", [arg2], result2, true) +RBS_CC_2_reportLine(603, 1): m.expectOnce(obj2, "mockMethod", [arg3], result3, true) - result = obj.mockMethod(arg1) - m.AssertEqual(result, result1) +RBS_CC_2_reportLine(605, 1): result = obj.mockMethod(arg1) +RBS_CC_2_reportLine(606, 1): m.AssertEqual(result, result1) - result = obj.mockMethod(arg2) - m.AssertEqual(result, result2) +RBS_CC_2_reportLine(608, 1): result = obj.mockMethod(arg2) +RBS_CC_2_reportLine(609, 1): m.AssertEqual(result, result2) - result = obj2.mockMethod(arg3) - m.AssertEqual(result, result3) +RBS_CC_2_reportLine(611, 1): result = obj2.mockMethod(arg3) +RBS_CC_2_reportLine(612, 1): m.AssertEqual(result, result3) - m.assertMocks() - isFail = m.currentResult.isFail +RBS_CC_2_reportLine(614, 1): m.assertMocks() +RBS_CC_2_reportLine(615, 1): isFail = m.currentResult.isFail - m.currentResult.Reset() - m.AssertFalse(isFail) +RBS_CC_2_reportLine(617, 1): m.currentResult.Reset() +RBS_CC_2_reportLine(618, 1): m.AssertFalse(isFail) end function @@ -657,4 +657,30 @@ end function ' ' 'Mocking and stubbing ' AssertMocks -' MockFail \ No newline at end of file +' MockFail + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_2_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":"2", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/BasicTests.brs b/outRun/.roku-deploy-staging/source/tests/BasicTests.brs deleted file mode 100644 index 22789cde..00000000 --- a/outRun/.roku-deploy-staging/source/tests/BasicTests.brs +++ /dev/null @@ -1,17 +0,0 @@ -'@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 \ No newline at end of file diff --git a/outRun/.roku-deploy-staging/source/tests/ExpectTests.brs b/outRun/.roku-deploy-staging/source/tests/ExpectTests.brs index 114ce322..91354e04 100644 --- a/outRun/.roku-deploy-staging/source/tests/ExpectTests.brs +++ b/outRun/.roku-deploy-staging/source/tests/ExpectTests.brs @@ -11,18 +11,45 @@ '@Params[["42"], true] '@Params[[42], false] function ET_expectOnce_valuesBug_reported(expectedValue, expectMockFail) as void - obj = { +RBS_CC_4_reportLine(13, 1): obj = { foo: function(arg0) : return arg0 : end function } - m.ExpectOnce(obj, "foo", expectedValue) - obj.foo(42) - m.isAutoAssertingMocks = false - m.AssertMocks() +RBS_CC_4_reportLine(17, 1): m.ExpectOnce(obj, "foo", expectedValue) +RBS_CC_4_reportLine(18, 1): obj.foo(42) +RBS_CC_4_reportLine(19, 1): m.isAutoAssertingMocks = false +RBS_CC_4_reportLine(20, 1): m.AssertMocks() - isFail = m.currentResult.isFail - m.currentResult.Reset() - m.CleanMocks() - m.AssertEqual(isFail, expectMockFail) +RBS_CC_4_reportLine(22, 1): isFail = m.currentResult.isFail +RBS_CC_4_reportLine(23, 1): m.currentResult.Reset() +RBS_CC_4_reportLine(24, 1): m.CleanMocks() +RBS_CC_4_reportLine(25, 1): m.AssertEqual(isFail, expectMockFail) end function + + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_4_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":"4", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/ParamsTests.brs b/outRun/.roku-deploy-staging/source/tests/ParamsTests.brs index a7ebed10..ff4d9921 100644 --- a/outRun/.roku-deploy-staging/source/tests/ParamsTests.brs +++ b/outRun/.roku-deploy-staging/source/tests/ParamsTests.brs @@ -9,7 +9,7 @@ '@Params["#RBSNode|Group", "Group"] '@Params["#RBSNode|Label", "Label"] function PT_RBSNodeDirective(node, expectedNodeType) as void - m.assertSubType(node, expectedNodeType) +RBS_CC_8_reportLine(11, 1): m.assertSubType(node, expectedNodeType) end function '@Test node parsed as other arg index @@ -17,10 +17,10 @@ end function '@Params[1, 2, 3, "#RBSNode|Group", "Group"] '@Params[1, 2, 3, "#RBSNode|Label", "Label"] function PT_RBSNodeDirective_otherArgs(arg1, arg2, arg3, node, expectedNodeType) as void - m.assertSubType(node, expectedNodeType) - m.assertEqual(arg1, 1) - m.assertEqual(arg2, 2) - m.assertEqual(arg3, 3) +RBS_CC_8_reportLine(19, 1): m.assertSubType(node, expectedNodeType) +RBS_CC_8_reportLine(20, 1): m.assertEqual(arg1, 1) +RBS_CC_8_reportLine(21, 1): m.assertEqual(arg2, 2) +RBS_CC_8_reportLine(22, 1): m.assertEqual(arg3, 3) end function '@Test does not affect regular params @@ -28,5 +28,31 @@ end function '@Params[22, 22] '@Params[[1,2,3], [1,2,3]] function PT_RBSNodeDirective_noSideEffect(arg1, expectedValue) as void - m.assertEqual(arg1, expectedValue) -end function \ No newline at end of file +RBS_CC_8_reportLine(30, 1): m.assertEqual(arg1, expectedValue) +end function + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_8_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":"8", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/issue_13_afterEach_not_running.brs b/outRun/.roku-deploy-staging/source/tests/issue_13_afterEach_not_running.brs index 228c7df5..c7efa39b 100644 --- a/outRun/.roku-deploy-staging/source/tests/issue_13_afterEach_not_running.brs +++ b/outRun/.roku-deploy-staging/source/tests/issue_13_afterEach_not_running.brs @@ -6,7 +6,7 @@ '@Test simple function DGNT_group1_test() - m.AssertTrue(true) +RBS_CC_5_reportLine(8, 1): m.AssertTrue(true) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -15,7 +15,7 @@ end function '@Test simple function DGNT_group2_test() - m.AssertTrue(true) +RBS_CC_5_reportLine(17, 1): m.AssertTrue(true) end function @@ -25,7 +25,7 @@ end function '@Test simple function DGNT_group2_dupe_test() - m.AssertTrue(true) +RBS_CC_5_reportLine(27, 1): m.AssertTrue(true) end function @@ -35,7 +35,7 @@ end function '@Test simple function DGNT_group3_test() - m.AssertTrue(true) +RBS_CC_5_reportLine(37, 1): m.AssertTrue(true) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -44,5 +44,31 @@ end function '@Test simple function DGNT_group1_dupe_test() - m.AssertTrue(true) -end function \ No newline at end of file +RBS_CC_5_reportLine(46, 1): m.AssertTrue(true) +end function + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_5_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":"5", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/issue_15_tests_only_on_groups.brs b/outRun/.roku-deploy-staging/source/tests/issue_15_tests_only_on_groups.brs index 67b33e76..63ece7fd 100644 --- a/outRun/.roku-deploy-staging/source/tests/issue_15_tests_only_on_groups.brs +++ b/outRun/.roku-deploy-staging/source/tests/issue_15_tests_only_on_groups.brs @@ -7,7 +7,7 @@ '@Test it one function RBSA__it_test_one() as void - m.AssertTrue(true) +RBS_CC_6_reportLine(9, 1): m.AssertTrue(true) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -16,7 +16,7 @@ end function '@Test it two function RBSA__it_test_two() as void - m.AssertTrue(true) +RBS_CC_6_reportLine(18, 1): m.AssertTrue(true) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -26,5 +26,31 @@ end function '@Test it three function RBSA__it_test_three() as void - m.AssertTrue(true) -end function \ No newline at end of file +RBS_CC_6_reportLine(28, 1): m.AssertTrue(true) +end function + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_6_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":"6", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/issue_5_duplicateGroupNames.brs b/outRun/.roku-deploy-staging/source/tests/issue_5_duplicateGroupNames.brs index 1725a4bb..67a70818 100644 --- a/outRun/.roku-deploy-staging/source/tests/issue_5_duplicateGroupNames.brs +++ b/outRun/.roku-deploy-staging/source/tests/issue_5_duplicateGroupNames.brs @@ -6,23 +6,49 @@ '@BeforeEach function RBSA__BeforeEach() as void - ? "!!! Before" +RBS_CC_7_reportLine(8, 1): ? "!!! Before" end function '@AfterEach function RBSA__AfterEach() as void - ? "!!! After" +RBS_CC_7_reportLine(14, 1): ? "!!! After" end function '@Test before after function RBSA__before_after() as void - assertResult = m.Fail("reason") +RBS_CC_7_reportLine(20, 1): assertResult = m.Fail("reason") - isFail = m.currentResult.isFail - m.currentResult.Reset() +RBS_CC_7_reportLine(22, 1): isFail = m.currentResult.isFail +RBS_CC_7_reportLine(23, 1): m.currentResult.Reset() - m.AssertFalse(assertResult) - m.AssertTrue(isFail) -end function \ No newline at end of file +RBS_CC_7_reportLine(25, 1): m.AssertFalse(assertResult) +RBS_CC_7_reportLine(26, 1): m.AssertTrue(isFail) +end function + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_7_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":"7", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/rooibosDist.brs b/outRun/.roku-deploy-staging/source/tests/rooibosDist.brs deleted file mode 100644 index ce088c6d..00000000 --- a/outRun/.roku-deploy-staging/source/tests/rooibosDist.brs +++ /dev/null @@ -1,2216 +0,0 @@ -'/** -' * rooibos - simple, flexible, fun brightscript test framework for roku scenegraph apps -' * @version v2.2.0 -' * @link https://github.com/georgejecook/rooibos#readme -' * @license MIT -' */ -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) - if testSceneName = invalid - testSceneName = "TestsScene" - end if - ? "Starting test using test scene with name TestsScene" ; testSceneName - scene = screen.CreateScene(testSceneName) - scene.id = "ROOT" - screen.show() - m.global = screen.getGlobalNode() - 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 - 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 while -end function -function BaseTestSuite() as object - this = {} - this.Name = "BaseTestSuite" - this.invalidValue = "#ROIBOS#INVALID_VALUE" ' special value used in mock arguments - this.ignoreValue = "#ROIBOS#IGNORE_VALUE" ' special value used in mock arguments - this.allowNonExistingMethodsOnMocks = true - this.isAutoAssertingMocks = true - this.TestCases = [] - this.AddTest = RBS_BTS_AddTest - this.CreateTest = RBS_BTS_CreateTest - this.GetLegacyCompatibleReturnValue = RBS_BTS_GetLegacyCompatibleReturnValue - this.Fail = RBS_BTS_Fail - this.AssertFalse = RBS_BTS_AssertFalse - this.AssertTrue = RBS_BTS_AssertTrue - this.AssertEqual = RBS_BTS_AssertEqual - this.AssertLike = RBS_BTS_AssertLike - this.AssertNotEqual = RBS_BTS_AssertNotEqual - this.AssertInvalid = RBS_BTS_AssertInvalid - this.AssertNotInvalid = RBS_BTS_AssertNotInvalid - this.AssertAAHasKey = RBS_BTS_AssertAAHasKey - this.AssertAANotHasKey = RBS_BTS_AssertAANotHasKey - this.AssertAAHasKeys = RBS_BTS_AssertAAHasKeys - this.AssertAANotHasKeys = RBS_BTS_AssertAANotHasKeys - this.AssertArrayContains = RBS_BTS_AssertArrayContains - this.AssertArrayNotContains = RBS_BTS_AssertArrayNotContains - this.AssertArrayContainsSubset = RBS_BTS_AssertArrayContainsSubset - this.AssertArrayContainsAAs = RBS_BTS_AssertArrayContainsAAs - this.AssertArrayNotContainsSubset = RBS_BTS_AssertArrayNotContainsSubset - this.AssertArrayCount = RBS_BTS_AssertArrayCount - this.AssertArrayNotCount = RBS_BTS_AssertArrayNotCount - this.AssertEmpty = RBS_BTS_AssertEmpty - this.AssertNotEmpty = RBS_BTS_AssertNotEmpty - this.AssertArrayContainsOnlyValuesOfType = RBS_BTS_AssertArrayContainsOnlyValuesOfType - this.AssertType = RBS_BTS_AssertType - this.AssertSubType = RBS_BTS_AssertSubType - this.AssertNodeCount = RBS_BTS_AssertNodeCount - this.AssertNodeNotCount = RBS_BTS_AssertNodeNotCount - this.AssertNodeEmpty = RBS_BTS_AssertNodeEmpty - this.AssertNodeNotEmpty = RBS_BTS_AssertNodenotEmpty - this.AssertNodeContains = RBS_BTS_AssertNodeContains - this.AssertNodeNotContains = RBS_BTS_AssertNodeNotContains - this.AssertNodeContainsFields = RBS_BTS_AssertNodeContainsFields - this.AssertNodeNotContainsFields = RBS_BTS_AssertNodeNotContainsFields - this.AssertAAContainsSubset = RBS_BTS_AssertAAContainsSubset - this.EqValues = RBS_BTS_EqValues - this.EqAssocArrays = RBS_BTS_EqAssocArray - this.EqArray = RBS_BTS_EqArray - this.Stub = RBS_BTS_Stub - this.Mock = RBS_BTS_Mock - this.AssertMocks = RBS_BTS_AssertMocks - this.CreateFake = RBS_BTS_CreateFake - this.CombineFakes = RBS_BTS_CombineFakes - this.MockFail = RBS_BTS_MockFail - this.CleanMocks = RBS_BTS_CleanMocks - this.CleanStubs = RBS_BTS_CleanStubs - this.ExpectOnce = RBS_BTS_ExpectOnce - this.ExpectNone = RBS_BTS_ExpectNone - this.Expect = RBS_BTS_Expect - this.ExpectOnceOrNone = RBS_BTS_ExpectOnceOrNone - this.MockCallback0 = RBS_BTS_MockCallback0 - this.MockCallback1 = RBS_BTS_MockCallback1 - this.MockCallback2 = RBS_BTS_MockCallback2 - this.MockCallback3 = RBS_BTS_MockCallback3 - this.MockCallback4 = RBS_BTS_MockCallback4 - this.MockCallback5 = RBS_BTS_MockCallback5 - this.StubCallback0 = RBS_BTS_StubCallback0 - this.StubCallback1 = RBS_BTS_StubCallback1 - this.StubCallback2 = RBS_BTS_StubCallback2 - this.StubCallback3 = RBS_BTS_StubCallback3 - this.StubCallback4 = RBS_BTS_StubCallback4 - this.StubCallback5 = RBS_BTS_StubCallback5 - this.pathAsArray_ = RBS_BTS_rodash_pathsAsArray_ - this.g = RBS_BTS_rodash_get_ - return this -end function -sub RBS_BTS_AddTest(name, func,funcName, setup = invalid, teardown = invalid) - m.testCases.Push(m.createTest(name, func, setup, teardown)) -end sub -function RBS_BTS_CreateTest(name, func, funcName, setup = invalid, teardown = invalid ) as object - if (func = invalid) - ? " ASKED TO CREATE TEST WITH INVALID FUNCITON POINTER FOR FUNCTION " ; funcName - end if - return { - Name: name - Func: func - FuncName: funcName - SetUp: setup - TearDown: teardown - } -end function -function RBS_BTS_Fail(msg = "Error" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) -end function -function RBS_BTS_GetLegacyCompatibleReturnValue(value) as object - if (value = true) - if (m.isLegacy = true) - return "" - else - return true - end if - else - if (m.isLegacy = true) - return "ERROR" - else - return false - end if - end if -end function -function RBS_BTS_AssertFalse(expr , msg = "Expression evaluates to true" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if not RBS_CMN_IsBoolean(expr) or expr - m.currentResult.AddResult(msg) - return m.fail(msg) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertTrue(expr , msg = "Expression evaluates to false" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if not RBS_CMN_IsBoolean(expr) or not expr then - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertEqual(first , second , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if not m.eqValues(first, second) - if msg = "" - first_as_string = RBS_CMN_AsString(first) - second_as_string = RBS_CMN_AsString(second) - msg = first_as_string + " != " + second_as_string - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertLike(first , second , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if first <> second - if msg = "" - first_as_string = RBS_CMN_AsString(first) - second_as_string = RBS_CMN_AsString(second) - msg = first_as_string + " != " + second_as_string - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNotEqual(first , second , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if m.eqValues(first, second) - if msg = "" - first_as_string = RBS_CMN_AsString(first) - second_as_string = RBS_CMN_AsString(second) - msg = first_as_string + " == " + second_as_string - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertInvalid(value , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if value <> invalid - if msg = "" - expr_as_string = RBS_CMN_AsString(value) - msg = expr_as_string + " <> Invalid" - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNotInvalid(value , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if value = invalid - if msg = "" - expr_as_string = RBS_CMN_AsString(value) - msg = expr_as_string + " = Invalid" - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertAAHasKey(array , key , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) - if not array.DoesExist(key) - if msg = "" - msg = "Array doesn't have the '" + key + "' key." - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Associative Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertAANotHasKey(array , key , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) - if array.DoesExist(key) - if msg = "" - msg = "Array has the '" + key + "' key." - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Associative Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertAAHasKeys(array , keys , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) and RBS_CMN_IsArray(keys) - for each key in keys - if not array.DoesExist(key) - if msg = "" - msg = "Array doesn't have the '" + key + "' key." - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for - else - msg = "Input value is not an Associative Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertAANotHasKeys(array , keys , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) and RBS_CMN_IsArray(keys) - for each key in keys - if array.DoesExist(key) - if msg = "" - msg = "Array has the '" + key + "' key." - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for - else - msg = "Input value is not an Associative Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayContains(array , value , key = invalid , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) or RBS_CMN_IsArray(array) - if not RBS_CMN_ArrayContains(array, value, key) - msg = "Array doesn't have the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayContainsAAs(array , values , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if not RBS_CMN_IsArray(values) - msg = "values to search for are not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - if RBS_CMN_IsArray(array) - for each value in values - isMatched = false - if not RBS_CMN_IsAssociativeArray(value) - msg = "Value to search for was not associativeArray "+ RBS_CMN_AsString(value) - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - for each item in array - if (RBS_CMN_IsAssociativeArray(item)) - isValueMatched = true - for each key in value - fieldValue = value[key] - itemValue = item[key] - if (not m.EqValues(fieldValue, itemValue)) - isValueMatched = false - exit for - end if - end for - if (isValueMatched) - isMatched = true - exit for - end if - end if - end for ' items in array - if not isMatched - msg = "array missing value: "+ RBS_CMN_AsString(value) - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for 'values to match - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayNotContains(array , value , key = invalid , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) or RBS_CMN_IsArray(array) - if RBS_CMN_ArrayContains(array, value, key) - msg = "Array has the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayContainsSubset(array , subset , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if (RBS_CMN_IsAssociativeArray(array) and RBS_CMN_IsAssociativeArray(subset)) or (RBS_CMN_IsArray(array) and RBS_CMN_IsArray(subset)) - isAA = RBS_CMN_IsAssociativeArray(subset) - for each item in subset - key = invalid - value = item - if isAA - key = item - value = subset[key] - end if - if not RBS_CMN_ArrayContains(array, value, key) - msg = "Array doesn't have the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayNotContainsSubset(array , subset , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if (RBS_CMN_IsAssociativeArray(array) and RBS_CMN_IsAssociativeArray(subset)) or (RBS_CMN_IsArray(array) and RBS_CMN_IsArray(subset)) - isAA = RBS_CMN_IsAssociativeArray(subset) - for each item in subset - key = invalid - value = item - if isAA - key = item - value = item[key] - end if - if RBS_CMN_ArrayContains(array, value, key) - msg = "Array has the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayCount(array , count , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) or RBS_CMN_IsArray(array) - if array.Count() <> count - msg = "Array items count " + RBS_CMN_AsString(array.Count()) + " <> " + RBS_CMN_AsString(count) + "." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayNotCount(array , count , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(array) or RBS_CMN_IsArray(array) - if array.Count() = count - msg = "Array items count = " + RBS_CMN_AsString(count) + "." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertEmpty(item , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(item) or RBS_CMN_IsArray(item) - if item.Count() > 0 - msg = "Array is not empty." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else if (RBS_CMN_IsString(item)) - if (RBS_CMN_AsString(item) <> "") - msg = "Input value is not empty." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "AssertEmpty: Input value was not an array or a string" - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNotEmpty(item , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if RBS_CMN_IsAssociativeArray(item) or RBS_CMN_IsArray(item) - if item.Count() = 0 - msg = "Array is empty." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else if RBS_CMN_IsString(item) - if (item = "") - msg = "Input value is empty." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not a string or array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertArrayContainsOnlyValuesOfType(array , typeStr , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if typeStr <> "String" and typeStr <> "Integer" and typeStr <> "Boolean" and typeStr <> "Array" and typeStr <> "AssociativeArray" - msg = "Type must be Boolean, String, Array, Integer, or AssociativeArray" - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - if RBS_CMN_IsAssociativeArray(array) or RBS_CMN_IsArray(array) - methodName = "RBS_CMN_Is" + typeStr - typeCheckFunction = RBS_CMN_GetIsTypeFunction(methodName) - if (typeCheckFunction <> invalid) - for each item in array - if not typeCheckFunction(item) - msg = RBS_CMN_AsString(item) + "is not a '" + typeStr + "' type." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for - else - msg = "could not find comparator for type '" + typeStr + "' type." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Array." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_CMN_GetIsTypeFunction(name) - if name = "RBS_CMN_IsFunction" - return RBS_CMN_IsFunction - else if name = "RBS_CMN_IsXmlElement" - return RBS_CMN_IsXmlElement - else if name = "RBS_CMN_IsInteger" - return RBS_CMN_IsInteger - else if name = "RBS_CMN_IsBoolean" - return RBS_CMN_IsBoolean - else if name = "RBS_CMN_IsFloat" - return RBS_CMN_IsFloat - else if name = "RBS_CMN_IsDouble" - return RBS_CMN_IsDouble - else if name = "RBS_CMN_IsLongInteger" - return RBS_CMN_IsLongInteger - else if name = "RBS_CMN_IsNumber" - return RBS_CMN_IsNumber - else if name = "RBS_CMN_IsList" - return RBS_CMN_IsList - else if name = "RBS_CMN_IsArray" - return RBS_CMN_IsArray - else if name = "RBS_CMN_IsAssociativeArray" - return RBS_CMN_IsAssociativeArray - else if name = "RBS_CMN_IsSGNode" - return RBS_CMN_IsSGNode - else if name = "RBS_CMN_IsString" - return RBS_CMN_IsString - else if name = "RBS_CMN_IsDateTime" - return RBS_CMN_IsDateTime - else if name = "RBS_CMN_IsUndefined" - return RBS_CMN_IsUndefined - else - return invalid - end if -end function -function RBS_BTS_AssertType(value , typeStr , msg ="" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(value) <> typeStr - if msg = "" - expr_as_string = RBS_CMN_AsString(value) - msg = expr_as_string + " was not expected type " + typeStr - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertSubType(value , typeStr , msg ="" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(value) <> "roSGNode" - if msg = "" - expr_as_string = RBS_CMN_AsString(value) - msg = expr_as_string + " was not a node, so could not match subtype " + typeStr - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - else if (value.subType() <> typeStr) - if msg = "" - expr_as_string = RBS_CMN_AsString(value) - msg = expr_as_string + "( type : " + value.subType() +") was not of subType " + typeStr - end if - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_EqValues(Value1 , Value2 ) as dynamic - val1Type = type(Value1) - val2Type = type(Value2) - if val1Type = "" or val2Type = "" or val1Type = "" or val2Type = "" - ? "ERROR!!!! - undefined value passed" - return false - end if - if val1Type = "roString" or val1Type = "String" - Value1 = RBS_CMN_AsString(Value1) - else - Value1 = box(Value1) - end if - if val2Type = "roString" or val2Type = "String" - Value2 = RBS_CMN_AsString(Value2) - else - Value2 = box(Value2) - end if - val1Type = type(Value1) - val2Type = type(Value2) - if val1Type = "roFloat" and val2Type = "roInt" - Value2 = box(Cdbl(Value2)) - else if val2Type = "roFloat" and val1Type = "roInt" - Value1 = box(Cdbl(Value1)) - end if - if val1Type <> val2Type - return false - else - valtype = val1Type - if valtype = "roList" - return RBS_BTS_EqArray(Value1, Value2) - else if valtype = "roAssociativeArray" - return RBS_BTS_EqAssocArray(Value1, Value2) - else if valtype = "roArray" - return RBS_BTS_EqArray(Value1, Value2) - else if (valtype = "roSGNode") - if (val2Type <> "roSGNode") - return false - else - return Value1.isSameNode(Value2) - end if - else - return Value1 = Value2 - end if - end if -end function -function RBS_BTS_EqAssocArray(Value1 , Value2 ) as dynamic - l1 = Value1.Count() - l2 = Value2.Count() - if not l1 = l2 - return false - else - for each k in Value1 - if not Value2.DoesExist(k) - return false - else - v1 = Value1[k] - v2 = Value2[k] - if not RBS_BTS_EqValues(v1, v2) - return false - end if - end if - end for - return true - end if -end function -function RBS_BTS_EqArray(Value1 , Value2 ) as dynamic - if not (RBS_CMN_IsArray(Value1)) or not RBS_CMN_IsArray(Value2) then return false - l1 = Value1.Count() - l2 = Value2.Count() - if not l1 = l2 - return false - else - for i = 0 to l1 - 1 - v1 = Value1[i] - v2 = Value2[i] - if not RBS_BTS_EqValues(v1, v2) then - return false - end if - end for - return true - end if -end function -function RBS_BTS_AssertNodeCount(node , count , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if node.getChildCount() <> count - msg = "node items count <> " + RBS_CMN_AsString(count) + ". Received " + RBS_CMN_AsString(node.getChildCount()) - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeNotCount(node , count , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if node.getChildCount() = count - msg = "node items count = " + RBS_CMN_AsString(count) + "." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeEmpty(node , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if node.getChildCount() > 0 - msg = "node is not empty." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeNotEmpty(node , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if node.Count() = 0 - msg = "Array is empty." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeContains(node , value , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if not RBS_CMN_NodeContains(node, value) - msg = "Node doesn't have the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeContainsOnly(node , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if not RBS_CMN_NodeContains(node, value) - msg = "Node doesn't have the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - else if node.getChildCount() <> 1 - msg = "Node Contains speicified value; but other values as well" - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeNotContains(node , value , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if type(node) = "roSGNode" - if RBS_CMN_NodeContains(node, value) - msg = "Node has the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - else - msg = "Input value is not an Node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeContainsFields(node , subset , ignoredFields=invalid, msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if ( type(node) = "roSGNode" and RBS_CMN_IsAssociativeArray(subset)) or ( type(node) = "roSGNode" and RBS_CMN_IsArray(subset)) - isAA = RBS_CMN_IsAssociativeArray(subset) - isIgnoredFields = RBS_CMN_IsArray(ignoredFields) - for each key in subset - if (key <> "") - if (not isIgnoredFields or not RBS_CMN_ArrayContains(ignoredFields, key)) - subsetValue = subset[key] - nodeValue = node[key] - if not m.eqValues(nodeValue, subsetValue) - msg = key + ": Expected '" + RBS_CMN_AsString(subsetValue) + "', got '" + RBS_CMN_AsString(nodeValue) + "'" - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end if - else - ? "Found empty key!" - end if - end for - else - msg = "Input value is not an Node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertNodeNotContainsFields(node , subset , msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if ( type(node) = "roSGNode" and RBS_CMN_IsAssociativeArray(subset)) or ( type(node) = "roSGNode" and RBS_CMN_IsArray(subset)) - isAA = RBS_CMN_IsAssociativeArray(subset) - for each item in subset - key = invalid - value = item - if isAA - key = item - value = item[key] - end if - if RBS_CMN_NodeContains(node, value, key) - msg = "Node has the '" + RBS_CMN_AsString(value) + "' value." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end for - else - msg = "Input value is not an Node." - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_AssertAAContainsSubset(array , subset , ignoredFields = invalid, msg = "" ) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - if (RBS_CMN_IsAssociativeArray(array) and RBS_CMN_IsAssociativeArray(subset)) - isAA = RBS_CMN_IsAssociativeArray(subset) - isIgnoredFields = RBS_CMN_IsArray(ignoredFields) - for each key in subset - if (key <> "") - if (not isIgnoredFields or not RBS_CMN_ArrayContains(ignoredFields, key)) - subsetValue = subset[key] - arrayValue = array[key] - if not m.eqValues(arrayValue, subsetValue) - msg = key + ": Expected '" + RBS_CMN_AsString(subsetValue) + "', got '" + RBS_CMN_AsString(arrayValue) + "'" - m.currentResult.AddResult(msg) - return m.GetLegacyCompatibleReturnValue(false) - end if - end if - else - ? "Found empty key!" - end if - end for - else - msg = "Input values are not an Associative Array." - return m.GetLegacyCompatibleReturnValue(false) - end if - m.currentResult.AddResult("") - return m.GetLegacyCompatibleReturnValue(true) -end function -function RBS_BTS_Stub(target, methodName, returnValue = invalid, allowNonExistingMethods = false) as object - if (type(target) <> "roAssociativeArray") - m.Fail("could not create Stub provided target was null") - return {} - end if - if (m.stubs =invalid) - m.__stubId = -1 - m.stubs = {} - end if - m.__stubId++ - if (m.__stubId > 5) - ? "ERROR ONLY 6 STUBS PER TEST ARE SUPPORTED!!" - return invalid - end if - id = stri(m.__stubId).trim() - fake = m.CreateFake(id, target, methodName, 1, invalid, returnValue) - m.stubs[id] = fake - allowNonExisting = m.allowNonExistingMethodsOnMocks = true or allowNonExistingMethods - isMethodPresent = type(target[methodName]) = "Function" or type(target[methodName]) = "roFunction" - if (isMethodPresent or allowNonExisting) - target[methodName] = m["StubCallback" + id] - target.__stubs = m.stubs - if (not isMethodPresent) - ? "WARNING - stubbing call " ; methodName; " which did not exist on target object" - end if - else - ? "ERROR - could not create Stub : method not found "; target ; "." ; methodName - end if - return fake -end function -function RBS_BTS_ExpectOnce(target, methodName, expectedArgs = invalid, returnValue = invalid, allowNonExistingMethods = false) as object - return m.Mock(target, methodName, 1, expectedArgs, returnValue, allowNonExistingMethods) -end function -function RBS_BTS_ExpectOnceOrNone(target, methodName, isExpected, expectedArgs = invalid, returnValue = invalid, allowNonExistingMethods = false) as object - if isExpected - return m.ExpectOnce(target, methodName, expectedArgs, returnValue, allowNonExistingMethods) - else - return m.ExpectNone(target, methodName, allowNonExistingMethods) - end if -end function -function RBS_BTS_ExpectNone(target, methodName, allowNonExistingMethods = false) as object - return m.Mock(target, methodName, 0, invalid, invalid, allowNonExistingMethods) -end function -function RBS_BTS_Expect(target, methodName, expectedInvocations = 1, expectedArgs = invalid, returnValue = invalid, allowNonExistingMethods = false) as object - return m.Mock(target, methodName, expectedInvocations, expectedArgs, returnValue, allowNonExistingMethods) -end function -function RBS_BTS_Mock(target, methodName, expectedInvocations = 1, expectedArgs = invalid, returnValue = invalid, allowNonExistingMethods = false) as object - if not RBS_CMN_IsAssociativeArray(target) - m.Fail("mock args: target was not an AA") - else if not RBS_CMN_IsString(methodName) - m.Fail("mock args: methodName was not a string") - else if not RBS_CMN_IsNumber(expectedInvocations) - m.Fail("mock args: expectedInvocations was not an int") - else if not RBS_CMN_IsArray(expectedArgs) and RBS_CMN_IsValid(expectedArgs) - m.Fail("mock args: expectedArgs was not invalid or an array of args") - else if RBS_CMN_IsUndefined(expectedArgs) - m.Fail("mock args: expectedArgs undefined") - end if - if m.currentResult.isFail - ? "ERROR: "; m.currentResult.messages[m.currentResult.currentAssertIndex - 1] - return {} - end if - if (m.mocks = invalid) - m.__mockId = -1 - m.__mockTargetId = -1 - m.mocks = {} - end if - fake = invalid - if not target.doesExist("__rooibosTargetId") - m.__mockTargetId++ - target["__rooibosTargetId"] = m.__mockTargetId - end if - for i = 0 to m.__mockId - id = stri(i).trim() - mock = m.mocks[id] - if mock <> invalid and mock.methodName = methodName and mock.target.__rooibosTargetId = target.__rooibosTargetId - fake = mock - exit for - end if - end for - if fake = invalid - m.__mockId++ - id = stri(m.__mockId).trim() - if (m.__mockId > 6) - ? "ERROR ONLY 6 MOCKS PER TEST ARE SUPPORTED!! you're on # " ; m.__mockId - ? " Method was " ; methodName - return invalid - end if - fake = m.CreateFake(id, target, methodName, expectedInvocations, expectedArgs, returnValue) - m.mocks[id] = fake 'this will bind it to m - allowNonExisting = m.allowNonExistingMethodsOnMocks = true or allowNonExistingMethods - isMethodPresent = type(target[methodName]) = "Function" or type(target[methodName]) = "roFunction" - if (isMethodPresent or allowNonExisting) - target[methodName] = m["MockCallback" + id] - target.__mocks = m.mocks - if (not isMethodPresent) - ? "WARNING - mocking call " ; methodName; " which did not exist on target object" - end if - else - ? "ERROR - could not create Mock : method not found "; target ; "." ; methodName - end if - else - m.CombineFakes(fake, m.CreateFake(id, target, methodName, expectedInvocations, expectedArgs, returnValue)) - end if - return fake -end function -function RBS_BTS_CreateFake(id, target, methodName, expectedInvocations = 1, expectedArgs =invalid, returnValue=invalid ) as object - expectedArgsValues = [] - hasArgs = RBS_CMN_IsArray(expectedArgs) - if (hasArgs) - defaultValue = m.invalidValue - else - defaultValue = m.ignoreValue - expectedArgs = [] - end if - for i = 0 to 9 - if (hasArgs and expectedArgs.count() > i) - value = expectedArgs[i] - if not RBS_CMN_IsUndefined(value) - expectedArgsValues.push(expectedArgs[i]) - else - expectedArgsValues.push("#ERR-UNDEFINED!") - end if - else - expectedArgsValues.push(defaultValue) - end if - end for - fake = { - id : id, - target: target, - methodName: methodName, - returnValue: returnValue, - isCalled: false, - invocations: 0, - invokedArgs: [invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid], - expectedArgs: expectedArgsValues, - expectedInvocations: expectedInvocations, - callback: function (arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - if (m.allInvokedArgs = invalid) - m.allInvokedArgs = [] - end if - m.invokedArgs = [arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 ] - m.allInvokedArgs.push ([arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 ]) - m.isCalled = true - m.invocations++ - if (type(m.returnValue) = "roAssociativeArray" and m.returnValue.doesExist("multiResult")) - returnValues = m.returnValue["multiResult"] - returnIndex = m.invocations -1 - if (type(returnValues) = "roArray" and returnValues.count() > 0) - if returnValues.count() <= m.invocations - returnIndex = returnValues.count() -1 - print "Multi return values all used up - repeating last value" - end if - return returnValues[returnIndex] - else - ? "Multi return value was specified; but no array of results were found" - return invalid - end if - else - return m.returnValue - end if - end function - } - return fake -end function -function RBS_BTS_CombineFakes(fake, otherFake) - if type(fake.expectedArgs) <> "roAssociativeArray" or not fake.expectedArgs.doesExist("multiInvoke") - currentExpectedArgsArgs = fake.expectedArgs - fake.expectedArgs = { - "multiInvoke": [currentExpectedArgsArgs] - } - end if - fake.expectedArgs.multiInvoke.push(otherFake.expectedArgs) - if type(fake.returnValue) <> "roAssociativeArray" or not fake.returnValue.doesExist("multiResult") - currentReturnValue = fake.returnValue - fake.returnValue = { - "multiResult": [currentReturnValue] - } - end if - fake.returnValue.multiResult.push(otherFake.returnValue) - fake.expectedInvocations++ -end function -function RBS_BTS_AssertMocks() as void - if (m.__mockId = invalid or not RBS_CMN_IsAssociativeArray(m.mocks)) - return - end if - lastId = int(m.__mockId) - for each id in m.mocks - mock = m.mocks[id] - methodName = mock.methodName - if (mock.expectedInvocations <> mock.invocations) - m.MockFail(methodName, "Wrong number of calls. (" + stri(mock.invocations).trim() + " / " + stri(mock.expectedInvocations).trim() + ")") - m.CleanMocks() - return - else if mock.expectedInvocations > 0 and (RBS_CMN_IsArray(mock.expectedArgs) or (type(mock.expectedArgs) = "roAssociativeArray" and RBS_CMN_IsArray(mock.expectedArgs.multiInvoke))) - isMultiArgsSupported = type(mock.expectedArgs) = "roAssociativeArray" and RBS_CMN_IsArray(mock.expectedArgs.multiInvoke) - for invocationIndex = 0 to mock.invocations - 1 - invokedArgs = mock.allInvokedArgs[invocationIndex] - if isMultiArgsSupported - expectedArgs = mock.expectedArgs.multiInvoke[invocationIndex] - else - expectedArgs = mock.expectedArgs - end if - for i = 0 to expectedArgs.count() -1 - value = invokedArgs[i] - expected = expectedArgs[i] - didNotExpectArg = RBS_CMN_IsString(expected) and expected = m.invalidValue - if (didNotExpectArg) - expected = invalid - end if - if (not (RBS_CMN_IsString(expected) and expected = m.ignoreValue) and not m.eqValues(value, expected)) - if (expected = invalid) - expected = "[INVALID]" - end if - m.MockFail(methodName, "on Invocation #" + stri(invocationIndex).trim() + ", expected arg #" + stri(i).trim() + " to be '" + RBS_CMN_AsString(expected) + "' got '" + RBS_CMN_AsString(value) + "')") - m.CleanMocks() - return - end if - end for - end for - end if - end for - m.CleanMocks() -end function -function RBS_BTS_CleanMocks() as void - if m.mocks = invalid return - for each id in m.mocks - mock = m.mocks[id] - mock.target.__mocks = invalid - end for - m.mocks = invalid - end function - function RBS_BTS_CleanStubs() as void - if m.stubs = invalid return - for each id in m.stubs - stub = m.stubs[id] - stub.target.__stubs = invalid - end for - m.stubs = invalid - end function - function RBS_BTS_MockFail(methodName, message) as dynamic - if (m.currentResult.isFail) then return m.GetLegacyCompatibleReturnValue(false) ' skip test we already failed - m.currentResult.AddResult("mock failure on '" + methodName + "' : " + message) - return m.GetLegacyCompatibleReturnValue(false) - end function - function RBS_BTS_StubCallback0(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__Stubs["0"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_StubCallback1(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__Stubs["1"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_StubCallback2(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__Stubs["2"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_StubCallback3(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__Stubs["3"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_StubCallback4(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__Stubs["4"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_StubCallback5(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__Stubs["5"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_MockCallback0(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__mocks["0"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_MockCallback1(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__mocks["1"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_MockCallback2(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__mocks["2"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_MockCallback3(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__mocks["3"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_MockCallback4(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__mocks["4"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_MockCallback5(arg1=invalid, arg2=invalid, arg3=invalid, arg4=invalid, arg5=invalid, arg6=invalid, arg7=invalid, arg8=invalid, arg9 =invalid)as dynamic - fake = m.__mocks["5"] - return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - end function - function RBS_BTS_rodash_pathsAsArray_(path) - pathRE = CreateObject("roRegex", "\[([0-9]+)\]", "i") - segments = [] - if type(path) = "String" or type(path) = "roString" - dottedPath = pathRE.replaceAll(path, ".\1") - stringSegments = dottedPath.tokenize(".") - for each s in stringSegments - if (Asc(s) >= 48) and (Asc(s) <= 57) - segments.push(s.toInt()) - else - segments.push(s) - end if - end for - else if type(path) = "roList" or type(path) = "roArray" - stringPath = "" - for each s in path - stringPath = stringPath + "." + Box(s).toStr() - end for - segments = m.pathAsArray_(stringPath) - else - segments = invalid - end if - return segments - end function - function RBS_BTS_rodash_get_(aa, path, default=invalid) - if type(aa) <> "roAssociativeArray" and type(aa) <> "roArray" and type(aa) <> "roSGNode" then return default - segments = m.pathAsArray_(path) - if (Type(path) = "roInt" or Type(path) = "roInteger" or Type(path) = "Integer") - path = stri(path).trim() - end if - if segments = invalid then return default - result = invalid - while segments.count() > 0 - key = segments.shift() - if (type(key) = "roInteger") 'it's a valid index - if (aa <> invalid and GetInterface(aa, "ifArray") <> invalid) - value = aa[key] - else if (aa <> invalid and GetInterface(aa, "ifSGNodeChildren") <> invalid) - value = aa.getChild(key) - else if (aa <> invalid and GetInterface(aa, "ifAssociativeArray") <> invalid) - key = tostr(key) - if not aa.doesExist(key) - exit while - end if - value = aa.lookup(key) - else - value = invalid - end if - else - if not aa.doesExist(key) - exit while - end if - value = aa.lookup(key) - end if - if segments.count() = 0 - result = value - exit while - end if - if type(value) <> "roAssociativeArray" and type(value) <> "roArray" and type(value) <> "roSGNode" - exit while - end if - aa = value - end while - if result = invalid then return default - return result - end function -function RBS_CMN_IsXmlElement(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifXMLElement") <> invalid -end function -function RBS_CMN_IsFunction(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifFunction") <> invalid -end function -function RBS_CMN_GetFunction(filename, functionName) as object - if (not RBS_CMN_IsNotEmptyString(functionName)) then return invalid - if (not RBS_CMN_IsNotEmptyString(filename)) then return invalid - mapFunction = RBSFM_getFunctionsForFile(filename) - if mapFunction <> invalid - map = mapFunction() - if (type(map) ="roAssociativeArray") - functionPointer = map[functionName] - return functionPointer - else - return invalid - end if - end if - return invalid -end function -function RBS_CMN_GetFunctionBruteForce(functionName) as object - if (not RBS_CMN_IsNotEmptyString(functionName)) then return invalid - 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") - functionPointer = map[functionName] - if functionPointer <> invalid - return functionPointer - end if - end if - end if - end for - return invalid -end function -function RBS_CMN_IsBoolean(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifBoolean") <> invalid -end function -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 -function RBS_CMN_IsFloat(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifFloat") <> invalid -end function -function RBS_CMN_IsDouble(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifDouble") <> invalid -end function -function RBS_CMN_IsLongInteger(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifLongInt") <> invalid -end function -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 -function RBS_CMN_IsList(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifList") <> invalid -end function -function RBS_CMN_IsArray(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifArray") <> invalid -end function -function RBS_CMN_IsAssociativeArray(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifAssociativeArray") <> invalid -end function -function RBS_CMN_IsSGNode(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifSGNodeChildren") <> invalid -end function -function RBS_CMN_IsString(value ) as boolean - return RBS_CMN_IsValid(value) and GetInterface(value, "ifString") <> invalid -end function -function RBS_CMN_IsNotEmptyString(value ) as boolean - return RBS_CMN_IsString(value) and len(value) > 0 -end function -function RBS_CMN_IsDateTime(value ) as boolean - return RBS_CMN_IsValid(value) and (GetInterface(value, "ifDateTime") <> invalid or Type(value) = "roDateTime") -end function -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 - return type(value) = "" or Type(value) = "" -end function -function RBS_CMN_ValidStr(obj ) as string - if obj <> invalid and GetInterface(obj, "ifString") <> invalid - return obj - else - return "" - end if -end function -function RBS_CMN_AsString(input ) as string - if RBS_CMN_IsValid(input) = false - return "" - else if RBS_CMN_IsString(input) - return input - else if RBS_CMN_IsInteger(input) or RBS_CMN_IsLongInteger(input) or RBS_CMN_IsBoolean(input) - return input.ToStr() - else if RBS_CMN_IsFloat(input) or RBS_CMN_IsDouble(input) - return Str(input).Trim() - else if type(input) = "roSGNode" - return "Node(" + input.subType() +")" - else if type(input) = "roAssociativeArray" - isFirst = true - text = "{" - if (not isFirst) - text += "," - isFirst = false - end if - for each key in input - text += key + ":" + RBS_CMN_AsString(input[key]) - end for - text += "}" - return text - else - return "" - end if -end function -function RBS_CMN_AsInteger(input ) as integer - if RBS_CMN_IsValid(input) = false - return 0 - else if RBS_CMN_IsString(input) - return input.ToInt() - else if RBS_CMN_IsInteger(input) - return input - else if RBS_CMN_IsFloat(input) or RBS_CMN_IsDouble(input) or RBS_CMN_IsLongInteger(input) - return Int(input) - else - return 0 - end if -end function -function RBS_CMN_AsLongInteger(input ) as longinteger - if RBS_CMN_IsValid(input) = false - return 0 - else if RBS_CMN_IsString(input) - return RBS_CMN_AsInteger(input) - else if RBS_CMN_IsLongInteger(input) or RBS_CMN_IsFloat(input) or RBS_CMN_IsDouble(input) or RBS_CMN_IsInteger(input) - return input - else - return 0 - end if -end function -function RBS_CMN_AsFloat(input ) as float - if RBS_CMN_IsValid(input) = false - return 0.0 - else if RBS_CMN_IsString(input) - return input.ToFloat() - else if RBS_CMN_IsInteger(input) - return (input / 1) - else if RBS_CMN_IsFloat(input) or RBS_CMN_IsDouble(input) or RBS_CMN_IsLongInteger(input) - return input - else - return 0.0 - end if -end function -function RBS_CMN_AsDouble(input ) as double - if RBS_CMN_IsValid(input) = false - return 0.0 - else if RBS_CMN_IsString(input) - return RBS_CMN_AsFloat(input) - else if RBS_CMN_IsInteger(input) or RBS_CMN_IsLongInteger(input) or RBS_CMN_IsFloat(input) or RBS_CMN_IsDouble(input) - return input - else - return 0.0 - end if -end function -function RBS_CMN_AsBoolean(input ) as boolean - if RBS_CMN_IsValid(input) = false - return false - else if RBS_CMN_IsString(input) - return LCase(input) = "true" - else if RBS_CMN_IsInteger(input) or RBS_CMN_IsFloat(input) - return input <> 0 - else if RBS_CMN_IsBoolean(input) - return input - else - return false - end if -end function -function RBS_CMN_AsArray(value ) as object - if RBS_CMN_IsValid(value) - if not RBS_CMN_IsArray(value) - return [value] - else - return value - end if - end if - return [] -end function -function RBS_CMN_IsNullOrEmpty(value ) as boolean - if RBS_CMN_IsString(value) - return Len(value) = 0 - else - return not RBS_CMN_IsValid(value) - end if -end function -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 - return -1 -end function -function RBS_CMN_ArrayContains(array , value , compareAttribute = invalid ) as boolean - return (RBS_CMN_FindElementIndexInArray(array, value, compareAttribute) > -1) -end function -function RBS_CMN_FindElementIndexInNode(node , value ) as integer - if type(node) = "roSGNode" - for i = 0 to node.getChildCount() - 1 - compareValue = node.getChild(i) - if type(compareValue) = "roSGNode" and compareValue.isSameNode(value) - return i - end if - next - end if - return -1 -end function -function RBS_CMN_NodeContains(node , value ) as boolean - return (RBS_CMN_FindElementIndexInNode(node, value) > -1) -end function -function RBS_ItG_GetTestCases(group) as object - if (group.hasSoloTests = true) - return group.soloTestCases - else - return group.testCases - end if -end function -function RBS_ItG_GetRunnableTestSuite(group) as object - testCases = RBS_ItG_GetTestCases(group) - runnableSuite = BaseTestSuite() - runnableSuite.name = group.name - runnableSuite.isLegacy = group.isLegacy = true - if group.testCaseLookup = invalid - group.testCaseLookup = {} - end if - for each testCase in testCases - name = testCase.name - if (testCase.isSolo = true) - name += " [SOLO] " - end if - testFunction = RBS_CMN_GetFunction(group.filename, testCase.funcName) - runnableSuite.addTest(name, testFunction, testCase.funcName) - group.testCaseLookup[name] = testCase - end for - runnableSuite.SetUp = RBS_CMN_GetFunction(group.filename, group.setupFunctionName) - runnableSuite.TearDown = RBS_CMN_GetFunction(group.filename, group.teardownFunctionName) - runnableSuite.BeforeEach = RBS_CMN_GetFunction(group.filename, group.beforeEachFunctionName) - runnableSuite.AfterEach = RBS_CMN_GetFunction(group.filename, group.afterEachFunctionName) - return runnableSuite -end function -function ItemGenerator(scheme as object) as object - this = {} - this.getItem = RBS_IG_GetItem - this.getAssocArray = RBS_IG_GetAssocArray - this.getArray = RBS_IG_GetArray - this.getSimpleType = RBS_IG_GetSimpleType - this.getInteger = RBS_IG_GetInteger - this.getFloat = RBS_IG_GetFloat - this.getString = RBS_IG_GetString - this.getBoolean = RBS_IG_GetBoolean - if not RBS_CMN_IsValid(scheme) - return invalid - end if - return this.getItem(scheme) -end function -function RBS_IG_GetItem(scheme as object) as object - item = invalid - if RBS_CMN_IsAssociativeArray(scheme) - item = m.getAssocArray(scheme) - else if RBS_CMN_IsArray(scheme) - item = m.getArray(scheme) - else if RBS_CMN_IsString(scheme) - item = m.getSimpleType(lCase(scheme)) - end if - return item -end function -function RBS_IG_GetAssocArray(scheme as object) as object - item = {} - for each key in scheme - if not item.DoesExist(key) - item[key] = m.getItem(scheme[key]) - end if - end for - return item -end function -function RBS_IG_GetArray(scheme as object) as object - item = [] - for each key in scheme - item.Push(m.getItem(key)) - end for - return item -end function -function RBS_IG_GetSimpleType(typeStr as string) as object - item = invalid - if typeStr = "integer" or typeStr = "int" or typeStr = "roint" - item = m.getInteger() - else if typeStr = "float" or typeStr = "rofloat" - item = m.getFloat() - else if typeStr = "string" or typeStr = "rostring" - item = m.getString(10) - else if typeStr = "boolean" or typeStr = "roboolean" - item = m.getBoolean() - end if - return item -end function -function RBS_IG_GetBoolean() as boolean - return RBS_CMN_AsBoolean(Rnd(2) \ Rnd(2)) -end function -function RBS_IG_GetInteger(seed = 100 as integer) as integer - return Rnd(seed) -end function -function RBS_IG_GetFloat() as float - return Rnd(0) -end function -function RBS_IG_GetString(seed as integer) as string - item = "" - if seed > 0 - stringLength = Rnd(seed) - for i = 0 to stringLength - chType = Rnd(3) - if chType = 1 'Chr(48-57) - numbers - chNumber = 47 + Rnd(10) - else if chType = 2 'Chr(65-90) - Uppercase Letters - chNumber = 64 + Rnd(26) - else 'Chr(97-122) - Lowercase Letters - chNumber = 96 + Rnd(26) - end if - item = item + Chr(chNumber) - end for - end if - return item -end function -function UnitTestRuntimeConfig() - this = {} - this.CreateSuites = RBS_CreateSuites - this.hasSoloSuites = false - this.hasSoloGroups = false - this.hasSoloTests = false - this.suites = this.CreateSuites() - return this -end function -function RBS_CreateSuites() - suites = RBSFM_getTestSuitesForProject() - includedSuites = [] - for i = 0 to suites.count() -1 - suite = suites[i] - if (suite.valid) - if (suite.isSolo) - m.hasSoloSuites = true - end if - if (suite.hasSoloTests = true) - m.hasSoloTests = true - end if - if (suite.hasSoloGroups = true) - m.hasSoloGroups = true - end if - includedSuites.Push(suite) - else - ? "ERROR! suite was not valid - ignoring" - end if - end for - return includedSuites -end function -function RBS_STATS_CreateTotalStatistic() as object - statTotalItem = { - Suites : [] - Time : 0 - Total : 0 - Correct : 0 - Fail : 0 - Ignored : 0 - Crash : 0 - IgnoredTestNames: [] - } - return statTotalItem -end function -function RBS_STATS_MergeTotalStatistic(stat1, stat2) as void - for each suite in stat2.Suites - stat1.Suites.push(suite) - end for - stat1.Time += stat2.Time - stat1.Total += stat2.Total - stat1.Correct += stat2.Correct - stat1.Fail += stat2.Fail - stat1.Crash += stat2.Crash - stat1.Ignored += stat2.Ignored - stat1.IgnoredTestNames.append(stat2.IgnoredTestNames) -end function -function RBS_STATS_CreateSuiteStatistic(name as string) as object - statSuiteItem = { - Name : name - Tests : [] - Time : 0 - Total : 0 - Correct : 0 - Fail : 0 - Crash : 0 - Ignored : 0 - IgnoredTestNames:[] - } - return statSuiteItem -end function -function RBS_STATS_CreateTestStatistic(name as string, result = "Success" as string, time = 0 as integer, errorCode = 0 as integer, errorMessage = "" as string) as object - statTestItem = { - Name : name - Result : result - Time : time - Error : { - Code : errorCode - Message : errorMessage - } - } - return statTestItem -end function -sub RBS_STATS_AppendTestStatistic(statSuiteObj as object, statTestObj as object) - if RBS_CMN_IsAssociativeArray(statSuiteObj) and RBS_CMN_IsAssociativeArray(statTestObj) - statSuiteObj.Tests.Push(statTestObj) - if RBS_CMN_IsInteger(statTestObj.time) - statSuiteObj.Time = statSuiteObj.Time + statTestObj.Time - end if - statSuiteObj.Total = statSuiteObj.Total + 1 - if lCase(statTestObj.Result) = "success" - statSuiteObj.Correct = statSuiteObj.Correct + 1 - else if lCase(statTestObj.result) = "fail" - statSuiteObj.Fail = statSuiteObj.Fail + 1 - else - statSuiteObj.crash = statSuiteObj.crash + 1 - end if - end if -end sub -sub RBS_STATS_AppendSuiteStatistic(statTotalObj as object, statSuiteObj as object) - if RBS_CMN_IsAssociativeArray(statTotalObj) and RBS_CMN_IsAssociativeArray(statSuiteObj) - statTotalObj.Suites.Push(statSuiteObj) - statTotalObj.Time = statTotalObj.Time + statSuiteObj.Time - if RBS_CMN_IsInteger(statSuiteObj.Total) - statTotalObj.Total = statTotalObj.Total + statSuiteObj.Total - end if - if RBS_CMN_IsInteger(statSuiteObj.Correct) - statTotalObj.Correct = statTotalObj.Correct + statSuiteObj.Correct - end if - if RBS_CMN_IsInteger(statSuiteObj.Fail) - statTotalObj.Fail = statTotalObj.Fail + statSuiteObj.Fail - end if - if RBS_CMN_IsInteger(statSuiteObj.Crash) - statTotalObj.Crash = statTotalObj.Crash + statSuiteObj.Crash - end if - end if -end sub -function UnitTestCase(name as string, func as dynamic, funcName as string, isSolo as boolean, isIgnored as boolean, lineNumber as integer, params = invalid, paramTestIndex =0, paramLineNumber = 0) - this = {} - this.isSolo = isSolo - this.func = func - this.funcName = funcName - this.isIgnored = isIgnored - this.name = name - this.lineNumber = lineNumber - this.paramLineNumber = paramLineNumber - this.assertIndex = 0 - this.assertLineNumberMap = {} - this.AddAssertLine = RBS_TC_AddAssertLine - this.getTestLineIndex = 0 - this.rawParams = params - this.paramTestIndex = paramTestIndex - this.isParamTest = false - this.time = 0 - if (params <> invalid) - this.name += stri(this.paramTestIndex) - end if - return this -end function -function RBS_TC_AddAssertLine(lineNumber as integer) - m.assertLineNumberMap[stri(m.assertIndex).trim()] = lineNumber - m.assertIndex++ -end function -function RBS_TC_GetAssertLine(testCase, index) - if (testCase.assertLineNumberMap.doesExist(stri(index).trim())) - return testCase.assertLineNumberMap[stri(index).trim()] - else - return testCase.lineNumber - end if -end function -function Logger(config) as object - this = {} - this.config = config - this.verbosityLevel = { - basic : 0 - normal : 1 - verbose : 2 - } - this.verbosity = this.config.logLevel - this.PrintStatistic = RBS_LOGGER_PrintStatistic - this.PrintMetaSuiteStart = RBS_LOGGER_PrintMetaSuiteStart - this.PrintSuiteStatistic = RBS_LOGGER_PrintSuiteStatistic - this.PrintTestStatistic = RBS_LOGGER_PrintTestStatistic - this.PrintStart = RBS_LOGGER_PrintStart - this.PrintEnd = RBS_LOGGER_PrintEnd - this.PrintSuiteStart = RBS_LOGGER_PrintSuiteStart - return this -end function -sub RBS_LOGGER_PrintStatistic(statObj as object) - m.PrintStart() - previousfile = invalid - for each testSuite in statObj.Suites - if (not statObj.testRunHasFailures or ((not m.config.showOnlyFailures) or testSuite.fail > 0 or testSuite.crash > 0)) - if (testSuite.metaTestSuite.filePath <> previousfile) - m.PrintMetaSuiteStart(testSuite.metaTestSuite) - previousfile = testSuite.metaTestSuite.filePath - end if - m.PrintSuiteStatistic(testSuite, statObj.testRunHasFailures) - end if - end for - ? "" - m.PrintEnd() - ? "Total = "; RBS_CMN_AsString(statObj.Total); " ; Passed = "; statObj.Correct; " ; Failed = "; statObj.Fail; " ; Ignored = "; statObj.Ignored - ? " Time spent: "; statObj.Time; "ms" - ? "" - ? "" - if (statObj.ignored > 0) - ? "IGNORED TESTS:" - for each ignoredItemName in statObj.IgnoredTestNames - print ignoredItemName - end for - end if - if (statObj.Total = statObj.Correct) - overrallResult = "Success" - else - overrallResult = "Fail" - end if - ? "RESULT: "; overrallResult -end sub -sub RBS_LOGGER_PrintSuiteStatistic(statSuiteObj as object, hasFailures) - m.PrintSuiteStart(statSuiteObj.Name) - for each testCase in statSuiteObj.Tests - if (not hasFailures or ((not m.config.showOnlyFailures) or testCase.Result <> "Success")) - m.PrintTestStatistic(testCase) - end if - end for - ? " |" -end sub -sub RBS_LOGGER_PrintTestStatistic(testCase as object) - metaTestCase = testCase.metaTestCase - if (LCase(testCase.Result) <> "success") - testChar = "-" - assertIndex = metaTestCase.testResult.failedAssertIndex - locationLine = StrI(RBS_TC_GetAssertLine(metaTestCase,assertIndex)).trim() - else - testChar = "|" - locationLine = StrI(metaTestCase.lineNumber).trim() - end if - locationText = testCase.filePath.trim() + "(" + locationLine + ")" - insetText = "" - if (metaTestcase.isParamTest <> true) - messageLine = RBS_LOGGER_FillText(" " + testChar + " |--" + metaTestCase.Name + " : ", ".", 80) - ? messageLine ; testCase.Result ; " (" + stri(metaTestCase.time).trim() +"ms)" - else if ( metaTestcase.paramTestIndex = 0) - name = metaTestCase.Name - if (len(name) > 1 and right(name, 1) = "0") - name = left(name, len(name) - 1) - end if - ? " " + testChar + " |--" + name+ " : " - end if - if (metaTestcase.isParamTest = true) - insetText = " " - messageLine = RBS_LOGGER_FillText(" " + testChar + insetText + " |--" + formatJson(metaTestCase.rawParams) + " : ", ".", 80) - ? messageLine ; testCase.Result ; " (" + stri(metaTestCase.time).trim() +"ms)" - end if - if LCase(testCase.Result) <> "success" - ? " | "; insettext ;" |--Location: "; locationText - if (metaTestcase.isParamTest = true) - ? " | "; insettext ;" |--Param Line: "; StrI(metaTestCase.paramlineNumber).trim() - end if - ? " | "; insettext ;" |--Error Message: "; testCase.Error.Message - end if -end sub -function RBS_LOGGER_FillText(text as string, fillChar = " ", numChars = 40) as string - if (len(text) >= numChars) - text = left(text, numChars - 5) + "..." + fillChar + fillChar - else - numToFill= numChars - len(text) -1 - for i = 0 to numToFill - text += fillChar - end for - end if - return text -end function -sub RBS_LOGGER_PrintStart() - ? "" - ? "[START TEST REPORT]" - ? "" -end sub -sub RBS_LOGGER_PrintEnd() - ? "" - ? "[END TEST REPORT]" - ? "" -end sub -sub RBS_LOGGER_PrintSuiteSetUp(sName as string) - if m.verbosity = m.verbosityLevel.verbose - ? "=================================================================" - ? "=== SetUp "; sName; " suite." - ? "=================================================================" - end if -end sub -sub RBS_LOGGER_PrintMetaSuiteStart(metaTestSuite) - ? metaTestSuite.name; " (" ; metaTestSuite.filePath + "(1))" -end sub -sub RBS_LOGGER_PrintSuiteStart(sName as string) - ? " |-" ; sName -end sub -sub RBS_LOGGER_PrintSuiteTearDown(sName as string) - if m.verbosity = m.verbosityLevel.verbose - ? "=================================================================" - ? "=== TearDown "; sName; " suite." - ? "=================================================================" - end if -end sub -sub RBS_LOGGER_PrintTestSetUp(tName as string) - if m.verbosity = m.verbosityLevel.verbose - ? "----------------------------------------------------------------" - ? "--- SetUp "; tName; " test." - ? "----------------------------------------------------------------" - end if -end sub -sub RBS_LOGGER_PrintTestTearDown(tName as string) - if m.verbosity = m.verbosityLevel.verbose - ? "----------------------------------------------------------------" - ? "--- TearDown "; tName; " test." - ? "----------------------------------------------------------------" - end if -end sub -function UnitTestResult() as object - this = {} - this.messages = CreateObject("roArray", 0, true) - this.isFail = false - this.currentAssertIndex = 0 - this.failedAssertIndex = 0 - this.Reset = RBS_TRes_Reset - this.AddResult = RBS_TRes_AddResult - this.GetResult = RBS_TRes_GetResult - return this -end function -function RBS_TRes_Reset() as void - m.isFail = false - m.messages = CreateObject("roArray", 0, true) -end function -function RBS_TRes_AddResult(message as string) as string - if (message <> "") - m.messages.push(message) - if (not m.isFail) - m.failedAssertIndex = m.currentAssertIndex - end if - m.isFail = true - end if - m.currentAssertIndex++ - return message -end function -function RBS_TRes_GetResult() as string - if (m.isFail) - msg = m.messages.peek() - if (msg <> invalid) - return msg - else - return "unknown test failure" - end if - else - return "" - end if -end function -function RBS_TR_TestRunner(args = {}) as object - this = {} - this.testScene = args.testScene - this.nodeContext = args.nodeContext - fs = CreateObject("roFileSystem") - defaultConfig = { - logLevel : 1, - testsDirectory: "pkg:/source/Tests", - testFilePrefix: "Test__", - failFast: false, - showOnlyFailures: false, - maxLinesWithoutSuiteDirective: 100 - } - rawConfig = invalid - config = invalid - if (args.testConfigPath <> invalid and fs.Exists(args.testConfigPath)) - ? "Loading test config from " ; args.testConfigPath - rawConfig = ReadAsciiFile(args.testConfigPath) - else if (fs.Exists("pkg:/source/tests/testconfig.json")) - ? "Loading test config from default location : pkg:/source/tests/testconfig.json" - rawConfig = ReadAsciiFile("pkg:/source/tests/testconfig.json") - else - ? "None of the testConfig.json locations existed" - end if - if (rawConfig <> invalid) - config = ParseJson(rawConfig) - end if - if (config = invalid or not RBS_CMN_IsAssociativeArray(config) or RBS_CMN_IsNotEmptyString(config.rawtestsDirectory)) - ? "WARNING : specified config is invalid - using default" - config = defaultConfig - end if - if (args.showOnlyFailures <> invalid) - config.showOnlyFailures = args.showOnlyFailures = "true" - end if - if (args.failFast <> invalid) - config.failFast = args.failFast = "true" - end if - this.testUtilsDecoratorMethodName = args.testUtilsDecoratorMethodName - this.config = config - this.config.testsDirectory = config.testsDirectory - this.logger = Logger(this.config) - this.global = args.global - this.Run = RBS_TR_Run - return this -end function -sub RBS_TR_Run() - if type(RBSFM_getTestSuitesForProject) <> "Function" - ? " ERROR! RBSFM_getTestSuitesForProject is not found! That looks like you didn't run the preprocessor as part of your test process. Please refer to the docs." - return - end if - totalStatObj = RBS_STATS_CreateTotalStatistic() - m.runtimeConfig = UnitTestRuntimeConfig() - m.runtimeConfig.global = m.global - totalStatObj.testRunHasFailures = false - for each metaTestSuite in m.runtimeConfig.suites - if (m.runtimeConfig.hasSoloTests = true) - if (metaTestSuite.hasSoloTests <> true) - if (m.config.logLevel = 2) - ? "TestSuite " ; metaTestSuite.name ; " Is filtered because it has no solo tests" - end if - goto skipSuite - end if - else if (m.runtimeConfig.hasSoloSuites) - if (metaTestSuite.isSolo <> true) - if (m.config.logLevel = 2) - ? "TestSuite " ; metaTestSuite.name ; " Is filtered due to solo flag" - end if - goto skipSuite - end if - end if - if (metaTestSuite.isIgnored = true) - if (m.config.logLevel = 2) - ? "Ignoring TestSuite " ; metaTestSuite.name ; " Due to Ignore flag" - end if - totalstatobj.ignored ++ - totalStatObj.IgnoredTestNames.push("|-" + metaTestSuite.name + " [WHOLE SUITE]") - goto skipSuite - end if - if (metaTestSuite.isNodeTest = true and metaTestSuite.nodeTestFileName <> "") - ? " +++++RUNNING NODE TEST" - nodeType = metaTestSuite.nodeTestFileName - ? " node type is " ; nodeType - node = m.testScene.CallFunc("Rooibos_CreateTestNode", nodeType) - if (type(node) = "roSGNode" and node.subType() = nodeType) - args = { - "metaTestSuite": metaTestSuite - "testUtilsDecoratorMethodName": m.testUtilsDecoratorMethodName - "config": m.config - "runtimeConfig": m.runtimeConfig - } - nodeStatResults = node.callFunc("Rooibos_RunNodeTests", args) - RBS_STATS_MergeTotalStatistic(totalStatObj, nodeStatResults) - m.testScene.RemoveChild(node) - else - ? " ERROR!! - could not create node required to execute tests for " ; metaTestSuite.name - ? " Node of type " ; nodeType ; " was not found/could not be instantiated" - end if - else - if (metaTestSuite.hasIgnoredTests) - totalStatObj.IgnoredTestNames.push("|-" + metaTestSuite.name) - end if - RBS_RT_RunItGroups(metaTestSuite, totalStatObj, m.testUtilsDecoratorMethodName, m.config, m.runtimeConfig, m.nodeContext) - end if - skipSuite: - end for - m.logger.PrintStatistic(totalStatObj) - RBS_TR_SendHomeKeypress() -end sub -sub RBS_RT_RunItGroups(metaTestSuite, totalStatObj, testUtilsDecoratorMethodName, config, runtimeConfig, nodeContext = invalid) - if (testUtilsDecoratorMethodName <> invalid) - testUtilsDecorator = RBS_CMN_GetFunctionBruteForce(testUtilsDecoratorMethodName) - if (not RBS_CMN_IsFunction(testUtilsDecorator)) - ? "[ERROR] Test utils decorator method `" ; testUtilsDecoratorMethodName ;"` was not in scope! for testSuite: " + metaTestSuite.name - end if - end if - for each itGroup in metaTestSuite.itGroups - testSuite = RBS_ItG_GetRunnableTestSuite(itGroup) - if (nodeContext <> invalid) - testSuite.node = nodeContext - testSuite.global = nodeContext.global - testSuite.top = nodeContext.top - end if - if (RBS_CMN_IsFunction(testUtilsDecorator)) - testUtilsDecorator(testSuite) - end if - totalStatObj.Ignored += itGroup.ignoredTestCases.count() - if (itGroup.isIgnored = true) - if (config.logLevel = 2) - ? "Ignoring itGroup " ; itGroup.name ; " Due to Ignore flag" - end if - totalStatObj.ignored += itGroup.testCases.count() - totalStatObj.IgnoredTestNames.push(" |-" + itGroup.name + " [WHOLE GROUP]") - goto skipItGroup - else - if (itGroup.ignoredTestCases.count() > 0) - totalStatObj.IgnoredTestNames.push(" |-" + itGroup.name) - totalStatObj.ignored += itGroup.ignoredTestCases.count() - for each testCase in itGroup.ignoredTestCases - if (testcase.isParamTest <> true) - totalStatObj.IgnoredTestNames.push(" | |--" + testCase.name) - else if (testcase.paramTestIndex = 0) - testCaseName = testCase.Name - if (len(testCaseName) > 1 and right(testCaseName, 1) = "0") - testCaseName = left(testCaseName, len(testCaseName) - 1) - end if - totalStatObj.IgnoredTestNames.push(" | |--" + testCaseName) - end if - end for - end if - end if - if (runtimeConfig.hasSoloTests) - if (itGroup.hasSoloTests <> true) - if (config.logLevel = 2) - ? "Ignoring itGroup " ; itGroup.name ; " Because it has no solo tests" - end if - goto skipItGroup - end if - else if (runtimeConfig.hasSoloGroups) - if (itGroup.isSolo <> true) - goto skipItGroup - end if - end if - if (testSuite.testCases.Count() = 0) - if (config.logLevel = 2) - ? "Ignoring TestSuite " ; itGroup.name ; " - NO TEST CASES" - end if - goto skipItGroup - end if - if RBS_CMN_IsFunction(testSuite.SetUp) - testSuite.SetUp() - end if - RBS_RT_RunTestCases(metaTestSuite, itGroup, testSuite, totalStatObj, config, runtimeConfig) - if RBS_CMN_IsFunction(testSuite.TearDown) - testSuite.TearDown() - end if - if (totalStatObj.testRunHasFailures = true and config.failFast = true) - exit for - end if - skipItGroup: - end for -end sub -sub RBS_RT_RunTestCases(metaTestSuite, itGroup, testSuite, totalStatObj, config, runtimeConfig) - suiteStatObj = RBS_STATS_CreateSuiteStatistic(itGroup.Name) - testSuite.global = runtimeConfig.global - for each testCase in testSuite.testCases - metaTestCase = itGroup.testCaseLookup[testCase.Name] - if (runtimeConfig.hasSoloTests and not metaTestCase.isSolo) - goto skipTestCase - end if - if RBS_CMN_IsFunction(testSuite.beforeEach) - testSuite.beforeEach() - end if - testTimer = CreateObject("roTimespan") - testCaseTimer = CreateObject("roTimespan") - testStatObj = RBS_STATS_CreateTestStatistic(testCase.Name) - testSuite.testCase = testCase.Func - testStatObj.filePath = metaTestSuite.filePath - testStatObj.metaTestCase = metaTestCase - testSuite.currentResult = UnitTestResult() - testStatObj.metaTestCase.testResult = testSuite.currentResult - if (metaTestCase.isParamsValid) - if (metaTestCase.isParamTest) - testCaseParams = [] - for paramIndex = 0 to metaTestCase.rawParams.count() - paramValue = metaTestCase.rawParams[paramIndex] - if type(paramValue) = "roString" and len(paramValue) >= 8 and left(paramValue, 8) = "#RBSNode" - nodeType = "ContentNode" - paramDirectiveArgs = paramValue.split("|") - if paramDirectiveArgs.count() > 1 - nodeType = paramDirectiveArgs[1] - end if - paramValue = createObject("roSGNode", nodeType) - end if - testCaseParams.push(paramValue) - end for - testCaseTimer.mark() - if (metaTestCase.expectedNumberOfParams = 1) - testSuite.testCase(testCaseParams[0]) - else if (metaTestCase.expectedNumberOfParams = 2) - testSuite.testCase(testCaseParams[0], testCaseParams[1]) - else if (metaTestCase.expectedNumberOfParams = 3) - testSuite.testCase(testCaseParams[0], testCaseParams[1], testCaseParams[2]) - else if (metaTestCase.expectedNumberOfParams = 4) - testSuite.testCase(testCaseParams[0], testCaseParams[1], testCaseParams[2], testCaseParams[3]) - else if (metaTestCase.expectedNumberOfParams = 5) - testSuite.testCase(testCaseParams[0], testCaseParams[1], testCaseParams[2], testCaseParams[3], testCaseParams[4]) - else if (metaTestCase.expectedNumberOfParams = 6) - testSuite.testCase(testCaseParams[0], testCaseParams[1], testCaseParams[2], testCaseParams[3], testCaseParams[4], testCaseParams[5]) - end if - metaTestCase.time = testCaseTimer.totalMilliseconds() - else - testCaseTimer.mark() - testSuite.testCase() - metaTestCase.time = testCaseTimer.totalMilliseconds() - end if - else - testSuite.Fail("Could not parse args for test ") - end if - if testSuite.isAutoAssertingMocks = true - testSuite.AssertMocks() - testSuite.CleanMocks() - testSuite.CleanStubs() - end if - runResult = testSuite.currentResult.GetResult() - if runResult <> "" - testStatObj.Result = "Fail" - testStatObj.Error.Code = 1 - testStatObj.Error.Message = runResult - else - testStatObj.Result = "Success" - end if - testStatObj.Time = testTimer.TotalMilliseconds() - RBS_STATS_AppendTestStatistic(suiteStatObj, testStatObj) - if RBS_CMN_IsFunction(testSuite.afterEach) - testSuite.afterEach() - end if - if testStatObj.Result <> "Success" - totalStatObj.testRunHasFailures = true - end if - if testStatObj.Result = "Fail" and config.failFast = true - exit for - end if - skipTestCase: - end for - suiteStatObj.metaTestSuite = metaTestSuite - RBS_STATS_AppendSuiteStatistic(totalStatObj, suiteStatObj) -end sub -sub RBS_TR_SendHomeKeypress() - ut = CreateObject("roUrlTransfer") - ut.SetUrl("http://localhost:8060/keypress/Home") - ut.PostFromString("") -end sub -function Rooibos_RunNodeTests(args) as object - ? " RUNNING NODE TESTS" - totalStatObj = RBS_STATS_CreateTotalStatistic() - RBS_RT_RunItGroups(args.metaTestSuite, totalStatObj, args.testUtilsDecoratorMethodName, args.config, args.runtimeConfig, m) - return totalStatObj -end function -function Rooibos_CreateTestNode(nodeType) as object - node = createObject("roSGNode", nodeType) - if (type(node) = "roSGNode" and node.subType() = nodeType) - m.top.AppendChild(node) - return node - else - ? " Error creating test node of type " ; nodeType - return invalid - end if -end function \ No newline at end of file diff --git a/outRun/.roku-deploy-staging/source/tests/testUtils.brs b/outRun/.roku-deploy-staging/source/tests/testUtils.brs index 54d2476d..cf5beac5 100644 --- a/outRun/.roku-deploy-staging/source/tests/testUtils.brs +++ b/outRun/.roku-deploy-staging/source/tests/testUtils.brs @@ -5,4 +5,30 @@ sub AddTestUtils(testCase) 'e.g. 'testCase.testUtils = TestUtils() 'testCase.r = rodash() -end sub \ No newline at end of file +end sub + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_9_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":"9", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/outRun/.roku-deploy-staging/source/tests/verifyBeforeEachAfterEach.brs b/outRun/.roku-deploy-staging/source/tests/verifyBeforeEachAfterEach.brs index 5bfae93e..bf6ce8b5 100644 --- a/outRun/.roku-deploy-staging/source/tests/verifyBeforeEachAfterEach.brs +++ b/outRun/.roku-deploy-staging/source/tests/verifyBeforeEachAfterEach.brs @@ -2,24 +2,24 @@ '@Setup function BEAER_Setup() as void - ? "!!! Setup" +RBS_CC_10_reportLine(4, 1): ? "!!! Setup" end function '@TearDown function BEAER_TearDown() as void - ? "!!! TearDown" +RBS_CC_10_reportLine(10, 1): ? "!!! TearDown" end function '@BeforeEach function BEAER_BeforeEach() as void - ? "!!! Before" +RBS_CC_10_reportLine(15, 1): ? "!!! Before" end function '@AfterEach function BEAER_AfterEach() as void - ? "!!! After" +RBS_CC_10_reportLine(21, 1): ? "!!! After" end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -28,12 +28,12 @@ end function '@Test 1 function BEAER_group1_1() as void - m.AssertTrue(true) +RBS_CC_10_reportLine(30, 1): m.AssertTrue(true) end function '@Test 2 function BEAER_group1_2() as void - m.AssertTrue(true) +RBS_CC_10_reportLine(35, 1): m.AssertTrue(true) end function '@Test 3 @@ -41,7 +41,7 @@ end function '@Params["b"] '@Params["c"] function BEAER_group1_3(values) as void - m.AssertTrue(true) +RBS_CC_10_reportLine(43, 1): m.AssertTrue(true) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -50,23 +50,23 @@ end function '@BeforeEach function BEAER_group2_BeforeEach() as void - ? "!!! Before GROUP 2" +RBS_CC_10_reportLine(52, 1): ? "!!! Before GROUP 2" end function '@AfterEach function BEAER_group2_AfterEach() as void - ? "!!! After GROUP 2" +RBS_CC_10_reportLine(58, 1): ? "!!! After GROUP 2" end function '@Test 1 function BEAER_group2_1() as void - m.AssertTrue(true) +RBS_CC_10_reportLine(63, 1): m.AssertTrue(true) end function '@Test 2 function BEAER_group2_2() as void - m.AssertTrue(true) +RBS_CC_10_reportLine(68, 1): m.AssertTrue(true) end function '@Test 3 @@ -74,7 +74,7 @@ end function '@Params["b"] '@Params["c"] function BEAER_group2_3(values) as void - m.AssertTrue(true) +RBS_CC_10_reportLine(76, 1): m.AssertTrue(true) end function '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -83,12 +83,12 @@ end function '@Test 1 function BEAER_group3_1() as void - m.AssertTrue(true) +RBS_CC_10_reportLine(85, 1): m.AssertTrue(true) end function '@Test 2 function BEAER_group3_2() as void - m.AssertTrue(true) +RBS_CC_10_reportLine(90, 1): m.AssertTrue(true) end function '@Test 3 @@ -96,5 +96,31 @@ end function '@Params["b"] '@Params["c"] function BEAER_group3_3(values) as void - m.AssertTrue(true) -end function \ No newline at end of file +RBS_CC_10_reportLine(98, 1): m.AssertTrue(true) +end function + + +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'++ rooibos code coverage util functions DO NOT MODIFY +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +function RBS_CC_10_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":"10", "l":stri(lineNumber), "r":reportType} + return true +end function diff --git a/package-lock.json b/package-lock.json index 201da320..31a890f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rooibos", - "version": "2.0.0", + "version": "3.0.0-beta", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -113,6 +113,7 @@ "version": "6.8.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", + "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -197,6 +198,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.0.0.tgz", "integrity": "sha512-5QeR6Xc5hSA9X1rbQfcuQ6VZuUXOaEdB65Dhmk9duuRJHYif/ZyJfuyJqsQrj34PFjU5emv5/MmfgA8un06onw==", + "dev": true, "requires": { "archiver-utils": "^2.0.0", "async": "^2.0.0", @@ -211,6 +213,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.0.0.tgz", "integrity": "sha512-JRBgcVvDX4Mwu2RBF8bBaHcQCSxab7afsxAPYDQ5W+19quIPP5CfKE7Ql+UHs9wYvwsaNR8oDuhtf5iqrKmzww==", + "dev": true, "requires": { "glob": "^7.0.0", "graceful-fs": "^4.1.0", @@ -229,7 +232,8 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true } } }, @@ -377,6 +381,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -384,7 +389,8 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "assign-symbols": { "version": "1.0.0", @@ -396,6 +402,7 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, "requires": { "lodash": "^4.17.10" } @@ -430,7 +437,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "atob": { "version": "2.1.2", @@ -441,12 +449,14 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true }, "babel-cli": { "version": "6.26.0", @@ -563,13 +573,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, + "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -837,7 +849,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -897,12 +910,14 @@ "base64-js": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -923,6 +938,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "dev": true, "requires": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" @@ -938,6 +954,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -972,10 +989,25 @@ } } }, + "brs": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/brs/-/brs-0.13.0.tgz", + "integrity": "sha512-v5LaVNEltZpO12Guw+TWicTwWF8oosioQv6Ln4u3eyBJI1WQe496QORBf1toMz1hiqmeFIGGZd+wT/T9Sepu4A==", + "dev": true, + "requires": { + "commander": "^2.12.2", + "lolex": "^3.0.0", + "long": "^3.2.0", + "luxon": "^1.8.3", + "memory-fs": "^0.4.1", + "p-settle": "^2.1.0" + } + }, "buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" @@ -985,6 +1017,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, "requires": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" @@ -993,12 +1026,14 @@ "buffer-alloc-unsafe": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true }, "buffer-equal": { "version": "1.0.0", @@ -1009,7 +1044,8 @@ "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true }, "buffer-from": { "version": "1.1.1", @@ -1048,7 +1084,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "catharsis": { "version": "0.8.9", @@ -1216,14 +1253,15 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "component-emitter": { @@ -1236,6 +1274,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz", "integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=", + "dev": true, "requires": { "buffer-crc32": "^0.2.1", "crc32-stream": "^2.0.0", @@ -1246,7 +1285,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", @@ -1301,9 +1341,9 @@ } }, "core-js": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", - "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.8.tgz", + "integrity": "sha512-RWlREFU74TEkdXzyl1bka66O3kYp8jeTXrvJZDzVVMH8AiHUSOFpL1yfhQJ+wHocAm1m+4971W1PPzfLuCv1vg==", "dev": true }, "core-util-is": { @@ -1315,6 +1355,7 @@ "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", + "dev": true, "requires": { "buffer": "^5.1.0" } @@ -1323,6 +1364,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz", "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=", + "dev": true, "requires": { "crc": "^3.4.4", "readable-stream": "^2.0.0" @@ -1341,6 +1383,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -1470,7 +1513,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "detect-file": { "version": "1.0.0", @@ -1602,6 +1646,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -1611,6 +1656,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -1621,6 +1667,15 @@ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1795,7 +1850,8 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extend-shallow": { "version": "3.0.2", @@ -1886,7 +1942,8 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fancy-log": { "version": "1.3.3", @@ -1903,12 +1960,14 @@ "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "filename-regex": { "version": "2.0.1", @@ -2020,12 +2079,14 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -2044,12 +2105,14 @@ "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true }, "fs-extra": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "dev": true, "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -2075,7 +2138,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "1.2.7", @@ -2097,7 +2161,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2118,12 +2183,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2138,17 +2205,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2265,7 +2335,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2277,6 +2348,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2291,6 +2363,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2298,12 +2371,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2322,6 +2397,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2402,7 +2478,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2414,6 +2491,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2499,7 +2577,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2535,6 +2614,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2554,6 +2634,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2597,12 +2678,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -2628,6 +2711,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -2636,6 +2720,7 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2649,6 +2734,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-all/-/glob-all-3.1.0.tgz", "integrity": "sha1-iRPd+17hrHgSZWJBsD1SF8ZLAqs=", + "dev": true, "requires": { "glob": "^7.0.5", "yargs": "~1.2.6" @@ -2657,12 +2743,14 @@ "minimist": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz", - "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=" + "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=", + "dev": true }, "yargs": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.2.6.tgz", "integrity": "sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=", + "dev": true, "requires": { "minimist": "^0.1.0" } @@ -2694,13 +2782,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, + "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -2815,7 +2905,8 @@ "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true }, "gulp": { "version": "4.0.0", @@ -3015,12 +3106,14 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, "requires": { "ajv": "^6.5.5", "har-schema": "^2.0.0" @@ -3144,6 +3237,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -3153,12 +3247,14 @@ "ieee754": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -3446,7 +3542,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-unc-path": { "version": "1.0.0", @@ -3495,7 +3592,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "js-tokens": { "version": "3.0.2", @@ -3515,7 +3613,8 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "jsdoc": { "version": "3.5.5", @@ -3546,12 +3645,14 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -3562,7 +3663,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "json5": { "version": "0.5.1", @@ -3574,6 +3676,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -3582,6 +3685,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -3624,6 +3728,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, "requires": { "readable-stream": "^2.0.5" } @@ -3678,7 +3783,8 @@ "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true }, "lodash._basecopy": { "version": "3.0.1", @@ -3736,7 +3842,8 @@ "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true }, "lodash.clonedeep": { "version": "4.5.0", @@ -3753,12 +3860,14 @@ "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", + "dev": true }, "lodash.difference": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=", + "dev": true }, "lodash.escape": { "version": "3.2.0", @@ -3778,7 +3887,8 @@ "lodash.flatten": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true }, "lodash.isarguments": { "version": "3.1.0", @@ -3795,7 +3905,8 @@ "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true }, "lodash.isstring": { "version": "4.0.1", @@ -3846,12 +3957,26 @@ "lodash.toarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", - "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=" + "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", + "dev": true }, "lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", - "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" + "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=", + "dev": true + }, + "lolex": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.1.0.tgz", + "integrity": "sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw==", + "dev": true + }, + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", + "dev": true }, "loose-envify": { "version": "1.4.0", @@ -3862,6 +3987,12 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "luxon": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.15.0.tgz", + "integrity": "sha512-HIpK4zIonObWHj9UC80ElykmM/0jTuuXcbPYBYbDGZ3Cq2bL9rACcmppoc6zm5JnmHpnK5bRMIp8/+ei4O0y2Q==", + "dev": true + }, "make-error": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", @@ -3921,6 +4052,16 @@ "dev": true, "optional": true }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, "merge2": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", @@ -3951,12 +4092,14 @@ "mime-db": { "version": "1.37.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true }, "mime-types": { "version": "2.1.21", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, "requires": { "mime-db": "~1.37.0" } @@ -3971,6 +4114,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4094,6 +4238,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, "requires": { "remove-trailing-separator": "^1.0.1" } @@ -4116,7 +4261,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -4250,6 +4396,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -4295,12 +4442,43 @@ "object-assign": "^4.1.0" } }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, "p-map": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", "dev": true }, + "p-reflect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-1.0.0.tgz", + "integrity": "sha1-9Poe4btUbY6z7AMhFI3+CnkTe7g=", + "dev": true + }, + "p-settle": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-settle/-/p-settle-2.1.0.tgz", + "integrity": "sha512-NHFIUYc+fQTFRrzzAugq0l1drwi57PB522smetcY8C/EoTYs6cU/fC6TJj0N3rq5NhhJJbhf0VGWziL3jZDnjA==", + "dev": true, + "requires": { + "p-limit": "^1.2.0", + "p-reflect": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -4329,7 +4507,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "2.0.1", @@ -4374,6 +4553,7 @@ "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "dev": true, "requires": { "process": "^0.11.1", "util": "^0.10.3" @@ -4397,7 +4577,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-is-inside": { "version": "1.0.2", @@ -4440,7 +4621,8 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "pify": { "version": "2.3.0", @@ -4602,7 +4784,8 @@ "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true }, "process-nextick-args": { "version": "1.0.7", @@ -4610,10 +4793,17 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, "psl": { "version": "1.1.31", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "dev": true }, "pump": { "version": "2.0.1", @@ -4639,17 +4829,20 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "randomatic": { "version": "3.1.1", @@ -4784,7 +4977,8 @@ "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true }, "repeat-element": { "version": "1.1.3", @@ -4828,6 +5022,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -4933,6 +5128,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-2.0.0.tgz", "integrity": "sha512-6dVJp6vl+13lZuN1/21YBsd8f6Lj0vHjAeY7M2XB7gFrsU7PNxf43R2UvNCd3FSHPqYXp/gs7C9MI/gjxWieOw==", + "dev": true, "requires": { "archiver": "^3.0.0", "fs-extra": "^5.0.0", @@ -4943,17 +5139,17 @@ } }, "rooibos-preprocessor": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/rooibos-preprocessor/-/rooibos-preprocessor-1.0.8.tgz", - "integrity": "sha512-0WCNXmxwBbBydqTFo6pw4r6CF6CiQoL3jB8Vj9Kt5mVLEaXW09hO8LKu5btzX6Awre6RsXpfOr7QwSZEiahJ+w==", + "version": "3.0.3-beta", + "resolved": "https://registry.npmjs.org/rooibos-preprocessor/-/rooibos-preprocessor-3.0.3-beta.tgz", + "integrity": "sha512-+TIZ5Y2SJ9MqItXQ5F84vTkBzG+JHkBS1BJ32JoNypc0ZODn8wTkIgjpb2AXrVD9VwECQy8DrEZh7SmqOYSzKg==", "dev": true, "requires": { "babel-cli": "^6.26.0", - "commander": "^2.19.0", + "brs": "^0.13.0", + "commander": "^2.20.0", "debug": "^4.1.1", "es2015": "0.0.0", "fs-extra": "^5.0.0", - "glob": "^7.1.3", "lodash": "^4.17.11", "replace-ext": "^1.0.0", "splice-string": "^2.0.0", @@ -5000,7 +5196,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "sanitize-html": { "version": "1.20.0", @@ -5319,6 +5516,7 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -5439,6 +5637,7 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, "requires": { "bl": "^1.0.0", "buffer-alloc": "^1.2.0", @@ -5487,7 +5686,8 @@ "to-buffer": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true }, "to-fast-properties": { "version": "1.0.3", @@ -5550,6 +5750,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -5558,7 +5759,8 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, @@ -5584,6 +5786,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -5591,7 +5794,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "typedarray": { "version": "0.0.6", @@ -5705,7 +5909,8 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true }, "unset-value": { "version": "1.0.0", @@ -5757,6 +5962,7 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -5783,6 +5989,7 @@ "version": "0.10.4", "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, "requires": { "inherits": "2.0.3" } @@ -5795,7 +6002,8 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true }, "v8flags": { "version": "3.1.2", @@ -5826,6 +6034,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -5923,7 +6132,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "xmlcreate": { "version": "1.0.2", @@ -5981,6 +6191,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.0.1.tgz", "integrity": "sha512-c+eUhhkDpaK87G/py74wvWLtz2kzMPNCCkUApkun50ssE0oQliIQzWpTnwjB+MTKVIf2tGzIgHyqW/Y+W77ecQ==", + "dev": true, "requires": { "archiver-utils": "^2.0.0", "compress-commons": "^1.2.0", diff --git a/package.json b/package.json index dfee58d1..0ff21540 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rooibos", - "version": "2.3.0", + "version": "3.0.0-beta", "description": "simple, flexible, fun brightscript test framework for roku scenegraph apps", "main": "index.js", "directories": { @@ -8,7 +8,6 @@ }, "dependencies": { "gulp-header": "^2.0.7", - "roku-deploy": "^2.0.0", "ts-node": "^8.0.2" }, "devDependencies": { @@ -19,10 +18,11 @@ "gulp-copy": "^4.0.1", "gulp-rm-lines": "0.0.9", "gulpclass": "^0.2.0", - "jsdoc": "3.5.5", "ink-docstrap": "1.3.0", + "jsdoc": "3.5.5", "minami": "^1.2.3", - "rooibos-preprocessor": "^1.0.8", + "roku-deploy": "^2.0.0", + "rooibos-preprocessor": "^3.0.3-beta", "typescript": "^3.3.1", "vinyl-paths": "^2.1.0" }, diff --git a/samples/example/source/tests/rooibos/rooibosDist.brs b/samples/example/source/tests/rooibos/rooibosDist.brs index b2ba0873..4ebede13 100644 --- a/samples/example/source/tests/rooibos/rooibosDist.brs +++ b/samples/example/source/tests/rooibos/rooibosDist.brs @@ -1,6 +1,6 @@ '/** ' * rooibos - simple, flexible, fun brightscript test framework for roku scenegraph apps -' * @version v2.3.0 +' * @version v3.0.0-beta ' * @link https://github.com/georgejecook/rooibos#readme ' * @license MIT ' */ @@ -674,13 +674,15 @@ function RBS_BTS_EqAssocArray(Value1 , Value2 ) as dynamic return false else for each k in Value1 - if not Value2.DoesExist(k) - return false - else - v1 = Value1[k] - v2 = Value2[k] - if not RBS_BTS_EqValues(v1, v2) + if k <> "__mocks" and k <> "__stubs" 'fix infinite loop/box crash when doing equals on an aa with a mock + if not Value2.DoesExist(k) return false + else + v1 = Value1[k] + v2 = Value2[k] + if not RBS_BTS_EqValues(v1, v2) + return false + end if end if end if end for @@ -2032,6 +2034,9 @@ sub RBS_TR_Run() skipSuite: end for m.logger.PrintStatistic(totalStatObj) + if RBS_CMN_IsFunction(RBS_ReportCodeCoverage) + RBS_ReportCodeCoverage() + end if RBS_TR_SendHomeKeypress() end sub sub RBS_RT_RunItGroups(metaTestSuite, totalStatObj, testUtilsDecoratorMethodName, config, runtimeConfig, nodeContext = invalid) diff --git a/src/Rooibos_BaseTestSuite.brs b/src/Rooibos_BaseTestSuite.brs index 48f2d463..1d2f7605 100644 --- a/src/Rooibos_BaseTestSuite.brs +++ b/src/Rooibos_BaseTestSuite.brs @@ -1012,13 +1012,15 @@ function RBS_BTS_EqAssocArray(Value1 , Value2 ) as dynamic return false else for each k in Value1 - if not Value2.DoesExist(k) - return false - else - v1 = Value1[k] - v2 = Value2[k] - if not RBS_BTS_EqValues(v1, v2) + if k <> "__mocks" and k <> "__stubs" 'fix infinite loop/box crash when doing equals on an aa with a mock + if not Value2.DoesExist(k) return false + else + v1 = Value1[k] + v2 = Value2[k] + if not RBS_BTS_EqValues(v1, v2) + return false + end if end if end if end for diff --git a/src/Rooibos_TestLogger.brs b/src/Rooibos_TestLogger.brs index 78afe08e..2ec36b43 100644 --- a/src/Rooibos_TestLogger.brs +++ b/src/Rooibos_TestLogger.brs @@ -83,11 +83,6 @@ sub RBS_LOGGER_PrintSuiteStatistic(statSuiteObj as object, hasFailures) ? " |" end sub -'---------------------------------------------------------------- -' Print test statistic. -' -' @param statTestObj (object) A target test object to print. -'---------------------------------------------------------------- sub RBS_LOGGER_PrintTestStatistic(testCase as object) metaTestCase = testCase.metaTestCase diff --git a/src/Rooibos_TestRunner.brs b/src/Rooibos_TestRunner.brs index 2ab7f9bb..64407c33 100644 --- a/src/Rooibos_TestRunner.brs +++ b/src/Rooibos_TestRunner.brs @@ -147,8 +147,11 @@ sub RBS_TR_Run() end if skipSuite: end for - m.logger.PrintStatistic(totalStatObj) + + if RBS_CMN_IsFunction(RBS_ReportCodeCoverage) + RBS_ReportCodeCoverage() + end if RBS_TR_SendHomeKeypress() end sub