Skip to content

Commit

Permalink
Adjust test logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Dec 22, 2023
1 parent 3f41d5d commit 4a0b2ea
Showing 1 changed file with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SystemBrowser default: Browser.

TestCase addSelectorSilently: #run: withMethod: (
TestCase
compile: 'run: aResult FileStream stdout nextPutAll: self asString; cr; flush. aResult runCase: self'
compile: 'run: aResult FileStream stdout nextPut: $.; flush. aResult runCase: self'
notifying: nil
trailer: (CompiledMethodTrailer empty) ifFail: [ 1 halt ]) method.

Expand Down Expand Up @@ -5805,21 +5805,42 @@ WorldState addDeferredUIMessage: [
FileStream stdout cr;
nextPutAll: 'Test results:'; cr;
nextPutAll: result asString; cr; flush.
exitCode := (result hasFailures or: [ result hasErrors ]) ifTrue: [ 1 ] ifFalse: [ 0 ].

result hasFailures ifTrue: [
FileStream stdout nextPutAll: 'Failures:'; cr; flush.
result failures do: [ :ea | FileStream stdout nextPutAll: ea asString; cr ]
FileStream stdout flush.
exitCode := 1.
]
result hasErrors ifTrue: [
FileStream stdout nextPutAll: 'Errors:'; cr; flush.
result errors do: [ :ea | FileStream stdout nextPutAll: ea asString; cr ]
FileStream stdout flush.
exitCode := 1.
]

FileStream stdout cr; nextPutAll: 'Running flaky tests...'; cr; flush.
result := TestSuite new addTests: flakyTests; run.
FileStream stdout cr;
nextPutAll: 'Test results:'; cr;
nextPutAll: result asString; cr; flush.
exitCode := result hasErrors ifTrue: [ 1 ] ifFalse: [ exitCode ].
result hasErrors ifTrue: [
FileStream stdout nextPutAll: 'Errors:'; cr; flush.
result errors do: [ :ea | FileStream stdout nextPutAll: ea asString; cr ]
FileStream stdout flush.
exitCode := 1.
]

FileStream stdout cr; nextPutAll: 'Running failing tests...'; cr; flush.
result := TestSuite new addTests: failingTests; run.
FileStream stdout cr;
nextPutAll: 'Test results:'; cr;
nextPutAll: result asString; cr; flush.
exitCode := result hasPassed ifTrue: [ 1 ] ifFalse: [ exitCode ].
result hasErrors ifTrue: [
FileStream stdout nextPutAll: 'Passing tests:'; cr; flush.
result passed do: [ :ea | FileStream stdout nextPutAll: ea asString; cr ]
FileStream stdout flush.
exitCode := 1.
]

Smalltalk quitPrimitive: exitCode
]

0 comments on commit 4a0b2ea

Please sign in to comment.