Skip to content
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
2 changes: 1 addition & 1 deletion src/Toplo-Examples/ToExWorkspace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Class {
ToExWorkspace class >> open [

<script>
self openInHost: BlOSWindowSDL2Host default
self openInHost: Bloc preferredHost
]

{ #category : #'instance creation' }
Expand Down
124 changes: 124 additions & 0 deletions src/Toplo-Examples/ToExamplesSmokeTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
Class {
#name : #ToExamplesSmokeTest,
#superclass : #BlParameterizedHostTest,
#instVars : [
'previousPreferredHost',
'exampleSelector'
],
#classVars : [
'Enabled'
],
#category : #'Toplo-Examples-Support'
}

{ #category : #settings }
ToExamplesSmokeTest class >> enabled [

^ Enabled ifNil: [ Enabled := true ]
]

{ #category : #settings }
ToExamplesSmokeTest class >> enabled: aBoolean [

Enabled := aBoolean
]

{ #category : #accessing }
ToExamplesSmokeTest class >> exampleSelectors [

^ (self targetClass class selectors select: [ :each |
(each beginsWith: 'example') and: [
(self ignoredExampleSelectors includes: each) not ] ])
asSortedCollection
]

{ #category : #accessing }
ToExamplesSmokeTest class >> ignoredExampleSelectors [

^ #( )
]

{ #category : #testing }
ToExamplesSmokeTest class >> isAbstract [

^ self == ToExamplesSmokeTest
]

{ #category : #settings }
ToExamplesSmokeTest class >> settingsOn: aBuilder [

<systemsettings>
(aBuilder setting: #enabled)
parent: #Toplo;
label: 'Enable Smoke tests';
default: true;
target: self;
description: 'Enable or disable ToExamplesSmokeTest and its subclasses'
]

{ #category : #accessing }
ToExamplesSmokeTest class >> targetClass [

^ nil
]

{ #category : #'building suites' }
ToExamplesSmokeTest class >> testParameters [

| matrix |
matrix := super testParameters.
self isAbstract ifTrue: [ ^ matrix ].
self exampleSelectors ifEmpty: [ ^ matrix ].

^ matrix * (ParametrizedTestMatrix new
forSelector: #exampleSelector
addOptions: self exampleSelectors)
]

{ #category : #accessing }
ToExamplesSmokeTest >> exampleSelector [

^ exampleSelector
]

{ #category : #accessing }
ToExamplesSmokeTest >> exampleSelector: aSymbol [

exampleSelector := aSymbol
]

{ #category : #running }
ToExamplesSmokeTest >> setUp [

super setUp.

self class enabled ifFalse: [
self skip: 'Smoke tests are disabled via system settings' ].

previousPreferredHost := BlHostRegistry default preferredHost.
BlHostRegistry default preferredHost: host
]

{ #category : #accessing }
ToExamplesSmokeTest >> targetClass [

^ self class targetClass
]

{ #category : #running }
ToExamplesSmokeTest >> tearDown [

BlHostRegistry default preferredHost: previousPreferredHost.

super tearDown
]

{ #category : #tests }
ToExamplesSmokeTest >> testSmoke [

[
self targetClass perform: exampleSelector.
self settleNonInitialSpaces
] ensure: [
self closeNonInitialSpaces ]
]
35 changes: 0 additions & 35 deletions src/Toplo-Examples/ToExperimentsMockTest.class.st

This file was deleted.

11 changes: 11 additions & 0 deletions src/Toplo-Examples/ToExperimentsSmokeTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Class {
#name : #ToExperimentsSmokeTest,
#superclass : #ToExamplesSmokeTest,
#category : #'Toplo-Examples-Experiments'
}

{ #category : #accessing }
ToExperimentsSmokeTest class >> targetClass [

^ ToExperiments
]
Loading