Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic management of variants in one place + Result view #123

Merged
merged 15 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Class {
#name : #SBActiveVariantPermutation,
#superclass : #ProcessLocalVariable,
#category : #'Sandblocks-Babylonian'
}
50 changes: 35 additions & 15 deletions packages/Sandblocks-Babylonian/SBExample.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ Class {
#category : #'Sandblocks-Babylonian'
}

{ #category : #'as yet unclassified' }
SBExample class >> getAllInMethod: aBlock [

^ aBlock body childSandblocks select: #isExample
]

{ #category : #'as yet unclassified' }
SBExample class >> instanceSuggestion [

Expand All @@ -46,6 +40,12 @@ SBExample class >> matches: aMessage [
and: [#('example:args:label:' 'example:args:label:assert:') includes: aMessage selector]]
]

{ #category : #constants }
SBExample class >> matchingSelectors [

^ #(#self:args:label: #self:args:label:assert: #example:args:label: #example:args:label:assert:)
]

{ #category : #'as yet unclassified' }
SBExample class >> newFor: aMessage [

Expand Down Expand Up @@ -368,15 +368,8 @@ SBExample >> providesExecutionEnvironment [
{ #category : #'as yet unclassified' }
SBExample >> run [

self containingArtefact valid ifFalse: [^ self].
processRunning ifTrue: [^ self].
currentProcess ifNotNil: #terminate.

errorDecorator ifNotNil: #detach.
errorDecorator := nil.
returnValue clear.
self runSetup.
self sendStartNotification.
"self collectTypeInfo."

processRunning := true.
currentProcess := [
Expand All @@ -394,7 +387,9 @@ SBExample >> run [
returnValue reportValue: returned.
returnValue updateDisplay.
self sendFinishNotification]
] forkAt: Processor userBackgroundPriority
] forkAt: Processor userBackgroundPriority.

^ currentProcess
]

{ #category : #'as yet unclassified' }
Expand All @@ -405,6 +400,31 @@ SBExample >> runOnlyThis [
self startRunning
]

{ #category : #'as yet unclassified' }
SBExample >> runSetup [

self containingArtefact valid ifFalse: [^ self].
processRunning ifTrue: [^ self].
currentProcess ifNotNil: #terminate.

errorDecorator ifNotNil: #detach.
errorDecorator := nil.
returnValue clear.
]

{ #category : #'as yet unclassified' }
SBExample >> runSynchronouslyIgnoreReturn [

| returned |
self sendStartNotification.

SBExecutionEnvironment value: self.
[returned := self evaluate] on: Error do: [:e | self scheduleLastError: e].
self scheduleLastError: nil.

self sendFinishNotification.
]

{ #category : #'as yet unclassified' }
SBExample >> scheduleLastError: anError [

Expand Down
29 changes: 27 additions & 2 deletions packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Class {
#category : #'Sandblocks-Babylonian'
}

{ #category : #actions }
SBExampleValueDisplay >> clear [

display clear.

hadValue := false
]

{ #category : #accessing }
SBExampleValueDisplay >> exampleFinished: anExample [

Expand All @@ -27,7 +35,6 @@ SBExampleValueDisplay >> exampleFinished: anExample [
SBExampleValueDisplay >> exampleStarting: anExample [

display exampleStarting: anExample.
display noValue.

statusLabel contents: '...'.
hadValue := false.
Expand Down Expand Up @@ -73,7 +80,7 @@ SBExampleValueDisplay >> layoutCommands [
]

{ #category : #naming }
SBExampleValueDisplay >> name: aString [
SBExampleValueDisplay >> name: aString [

label contents: aString
]
Expand All @@ -85,3 +92,21 @@ SBExampleValueDisplay >> reportValue: anObject name: aString [
label contents: aString.
hadValue := true
]

{ #category : #'event handling' }
SBExampleValueDisplay >> reportValues: aCollectionOfObjects name: aString [

display reportValues: aCollectionOfObjects.
label contents: aString.
hadValue := true
]

{ #category : #actions }
SBExampleValueDisplay >> updateDisplay [

display updateDisplay.

statusLabel contents: (hadValue
ifTrue: ['']
ifFalse: ['- Not reached -'])
]
Loading
Loading