Skip to content

Commit

Permalink
Updated the console test reporter to handle skipped and ignored tests…
Browse files Browse the repository at this point in the history
…/groups/suites
  • Loading branch information
chrisdp committed Jan 10, 2025
1 parent 707e01c commit 042fe6d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework/src/source/ConsoleTestReporter.bs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ namespace rooibos
end function

override function onSuiteBegin(suite as rooibos.BaseTestSuite)
if suite.isIgnored then return invalid
? ""
? rooibos.common.fillText("> SUITE: " + suite.name, ">", 80)
end function

override function onTestGroupBegin(group as rooibos.TestGroup)
if group.isIgnored then return invalid
? ""
? rooibos.common.fillText(">>>> Describe: " + group.name, ">", 80)
'bs:disable-next-line
Expand All @@ -27,13 +29,15 @@ namespace rooibos
end function

override function onTestBegin(test as rooibos.Test)
if test.isIgnored then return invalid
? ""
? rooibos.common.fillText(">>>>>> It: " + test.name, ">", 80)
? ` Location: file://${test.testSuite.filePath.trim()}:${test.lineNumber}`
? ""
end function

override function onTestComplete(test as rooibos.Test)
if test.isIgnored then return invalid
? rooibos.common.fillText("<<<< END It: " + test.name + " (" + test.result.getStatusText() + ") ", "<", 80)
end function

Expand All @@ -49,6 +53,7 @@ namespace rooibos
m.allStats = ev.stats
m.startReport()
for each testSuite in m.testRunner.testSuites
if testSuite.isIgnored then return invalid
if not m.allStats.hasFailures or ((not m.config.showOnlyFailures) or testSuite.stats.failedCount > 0 or testSuite.stats.crashedCount > 0)
m.printSuiteStart(testSuite)

Expand Down Expand Up @@ -91,9 +96,11 @@ namespace rooibos
end function

function printGroup(testGroup)
if testGroup.isIgnored then return invalid
isGroupPrinted = false

for each test in testGroup.tests
if test.result.isSkipped then return invalid
if not m.allStats.hasFailures or ((not m.config.showOnlyFailures) or test.result.isFail)
if not isGroupPrinted
m.printGroupStart(testGroup)
Expand Down

0 comments on commit 042fe6d

Please sign in to comment.