Don't print empty suites (#50)

In compact mode, remove "empty" suites, which most often happens when
filtering which tests to run
This commit is contained in:
Jacek Sieka 2025-02-14 15:42:56 +01:00 committed by GitHub
parent 88a613ffa4
commit 9c716f162a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -615,15 +615,22 @@ method suiteEnded*(formatter: ConsoleOutputFormatter) =
totalDurStr = formatDuration(totalDur, false)
if formatter.outputLevel == OutputLevel.COMPACT:
# Complete the line with timing information
formatter.write do:
if totalDur > slowThreshold:
stdout.styledWrite(" ", styleBright, totalDurStr)
else:
stdout.write(" ", totalDurStr)
echo ""
do:
echo(" ", totalDurStr)
if formatter.results.len > 0:
# Complete the line with timing information
formatter.write do:
if totalDur > slowThreshold:
stdout.styledWrite(" ", styleBright, totalDurStr)
else:
stdout.write(" ", totalDurStr)
echo ""
do:
echo(" ", totalDurStr)
else:
formatter.write do:
# If no tests were run, remove the suite name
stdout.eraseLine()
do:
stdout.writeLine("")
var failed = false
if formatter.outputLevel notin {VERBOSE, FAILURES}: