diff --git a/framework/src/source/BaseTestReporter.bs b/framework/src/source/BaseTestReporter.bs index 390ef882..e7fda9dd 100644 --- a/framework/src/source/BaseTestReporter.bs +++ b/framework/src/source/BaseTestReporter.bs @@ -1,4 +1,8 @@ namespace rooibos + interface TestReporterOnEndEvent + stats as rooibos.Stats + end interface + class BaseTestReporter public testRunner = invalid @@ -11,11 +15,11 @@ namespace rooibos m.allStats = runner.stats end function - function onBegin() + function onBegin(ev as dynamic) 'override me end function - function onEnd(allStats as dynamic) + function onEnd(ev as rooibos.TestReporterOnEndEvent) 'override me end function diff --git a/framework/src/source/ConsoleTestReporter.bs b/framework/src/source/ConsoleTestReporter.bs index 0f448959..2e0a7bde 100644 --- a/framework/src/source/ConsoleTestReporter.bs +++ b/framework/src/source/ConsoleTestReporter.bs @@ -13,8 +13,8 @@ namespace rooibos end if end function - override function onEnd(allStats) - m.allStats = allStats + override function onEnd(ev as rooibos.TestReporterOnEndEvent) + m.allStats = ev.stats m.startReport() for each testSuite in m.testRunner.testSuites if not m.allStats.hasFailures or ((not m.config.showOnlyFailures) or testSuite.stats.failedCount > 0 or testSuite.stats.crashedCount > 0) diff --git a/framework/src/source/JUnitTestReporter.bs b/framework/src/source/JUnitTestReporter.bs index 0229e248..eacaff7e 100644 --- a/framework/src/source/JUnitTestReporter.bs +++ b/framework/src/source/JUnitTestReporter.bs @@ -1,7 +1,7 @@ namespace rooibos class JUnitTestReporter extends rooibos.BaseTestReporter - override function onEnd(allStats as dynamic) + override function onEnd(ev as rooibos.TestReporterOnEndEvent) 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 c49b83b8..e216b0d0 100644 --- a/framework/src/source/TestRunner.bs +++ b/framework/src/source/TestRunner.bs @@ -47,7 +47,7 @@ namespace rooibos for each reporter in m.testReporters if rooibos.common.isFunction(reporter.onBegin) - reporter.onBegin() + reporter.onBegin({}) end if end for @@ -107,7 +107,7 @@ namespace rooibos for each reporter in m.testReporters if rooibos.common.isFunction(reporter.onEnd) - reporter.onEnd(m.stats) + reporter.onEnd({ stats: m.stats }) end if end for