Skip to content

Commit

Permalink
Improving the testing of known processes in ReleaseTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Jul 1, 2020
1 parent 14948ae commit e1c2179
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
6 changes: 6 additions & 0 deletions src/Polymorph-Widgets/MorphicUIManager.class.st
Expand Up @@ -32,6 +32,12 @@ MorphicUIManager class >> isValidForCurrentSystemConfiguration [
and: [ Smalltalk isInteractiveGraphic ] ]
]

{ #category : #'ui process' }
MorphicUIManager class >> uiProcess [

^ UIProcess
]

{ #category : #private }
MorphicUIManager >> activate [

Expand Down
40 changes: 20 additions & 20 deletions src/ReleaseTests/ReleaseTest.class.st
Expand Up @@ -18,22 +18,6 @@ ReleaseTest class >> defaultTimeLimit [
^ 1 minute
]

{ #category : #accessing }
ReleaseTest class >> knownProcesses [
"Return a dynamic list of know processes"

"(self actualProcesses difference: self knownProcesses) do: [ :each | each suspend; terminate ]."

^ {
Processor activeProcess.
InputEventFetcher default fetcherProcess.
WeakArray runningFinalizationProcess.
Processor backgroundProcess.
SmalltalkImage current lowSpaceWatcherProcess.
UIManager default uiProcess.
Delay schedulingProcess } asSet
]

{ #category : #accessing }
ReleaseTest >> actualProcesses [
^ self class actualProcesses
Expand Down Expand Up @@ -82,7 +66,19 @@ ReleaseTest >> hasStartUpOrShutDownMethod: aClass [

{ #category : #accessing }
ReleaseTest >> knownProcesses [
^ self class knownProcesses
"Return a dynamic list of know processes"

"(self actualProcesses difference: self knownProcesses) do: [ :each | each suspend; terminate ]."

^ {
Processor activeProcess.
Processor backgroundProcess.
InputEventFetcher default fetcherProcess.
WeakArray runningFinalizationProcess.
SmalltalkImage current lowSpaceWatcherProcess.
MorphicUIManager uiProcess.
CurrentExecutionEnvironment value watchDogProcess.
Delay schedulingProcess } asSet
]

{ #category : #tests }
Expand Down Expand Up @@ -332,12 +328,16 @@ ReleaseTest >> testUnknownProcesses [
| unknownProcesses |
unknownProcesses := self actualProcesses difference: self knownProcesses.
self
assert: unknownProcesses size <=2
assert: unknownProcesses isEmpty
description: (String streamContents: [ :out |
out << 'Found unknown processes: '.
unknownProcesses
do: [ :each | out print: each ]
separatedBy: [ out << ', ' ] ])
do: [ :each |
out
print: each name;
print: ':';
print: each ]
separatedBy: [ out << String crlf ] ])
]

{ #category : #'tests - rpackage' }
Expand Down
6 changes: 6 additions & 0 deletions src/SUnit-Core/TestExecutionEnvironment.class.st
Expand Up @@ -231,3 +231,9 @@ TestExecutionEnvironment >> watchDogLoopFor: testProcess [


]

{ #category : #accessing }
TestExecutionEnvironment >> watchDogProcess [

^ watchDogProcess
]

0 comments on commit e1c2179

Please sign in to comment.