diff --git a/framework/src/source/BaseTestReporter.bs b/framework/src/source/BaseTestReporter.bs index 2f114272..390ef882 100644 --- a/framework/src/source/BaseTestReporter.bs +++ b/framework/src/source/BaseTestReporter.bs @@ -11,15 +11,11 @@ namespace rooibos m.allStats = runner.stats end function - function reportResults(allStats as dynamic) + function onBegin() 'override me end function - function testLogInfo(text as string) - 'override me - end function - - function testLogError(text as string) + function onEnd(allStats as dynamic) 'override me end function diff --git a/framework/src/source/ConsoleTestReporter.bs b/framework/src/source/ConsoleTestReporter.bs index d0e609f4..0f448959 100644 --- a/framework/src/source/ConsoleTestReporter.bs +++ b/framework/src/source/ConsoleTestReporter.bs @@ -13,7 +13,7 @@ namespace rooibos end if end function - override function reportResults(allStats) + override function onEnd(allStats) m.allStats = allStats m.startReport() for each testSuite in m.testRunner.testSuites @@ -186,14 +186,6 @@ namespace rooibos '++ printing '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - override function testLogInfo(text) - ? "INFO " ; text - end function - - override function testLogError(text) - ? "ERROR " ; text - end function - function printLine(depth = 0, text = "") ? " " ; text end function diff --git a/framework/src/source/JUnitTestReporter.bs b/framework/src/source/JUnitTestReporter.bs index 16a781f4..ace166f6 100644 --- a/framework/src/source/JUnitTestReporter.bs +++ b/framework/src/source/JUnitTestReporter.bs @@ -6,7 +6,7 @@ namespace rooibos super(testRunner) end function - override function reportResults(allStats as dynamic) + override function onEnd(allStats as dynamic) root = createObject("roXMLElement") root.SetName("testsuites") properties = root.addElement("properties") diff --git a/framework/src/source/TestRunner.bs b/framework/src/source/TestRunner.bs index e0a8218a..deef3b55 100644 --- a/framework/src/source/TestRunner.bs +++ b/framework/src/source/TestRunner.bs @@ -45,6 +45,10 @@ namespace rooibos ' */ public function run() + for each reporter in m.testReporters + reporter.onBegin() + end for + rooibosTimer = createObject("roTimespan") rooibosTimer.mark() suiteNames = m.runtimeConfig.getAllTestSuitesNames() @@ -100,7 +104,7 @@ namespace rooibos m.stats.time = rooibosTimer.totalMilliseconds() for each reporter in m.testReporters - reporter.reportResults(m.stats) + reporter.onEnd(m.stats) end for rooibosResult = {