Skip to content

Commit ad1e07a

Browse files
committed
Speedup test regeneration in case nothing changed
1 parent 4c8bc82 commit ad1e07a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎src/FAST-Python-Tools-Tests/FASTPyImporterTestGenerator.class.st‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ FASTPyImporterTestGenerator >> generateAssertionsFor: entity pushing: pushString
140140
tab: indentation ].
141141
]
142142

143+
{ #category : 'test generation' }
144+
FASTPyImporterTestGenerator >> generateMethod: aString inProtocol: protocol [
145+
146+
self testCase
147+
compiledMethodAt: aString lines first asSymbol
148+
ifPresent: [ :method | method sourceCode = aString ifTrue: [ ^ self "No need to recompile here." ] ].
149+
150+
self testCase compile: stream contents classified: protocol
151+
]
152+
143153
{ #category : 'test generation' }
144154
FASTPyImporterTestGenerator >> generateTestNamed: aString fromCode: code protocol: protocol [
145155

@@ -188,7 +198,7 @@ FASTPyImporterTestGenerator >> generateTestNamed: aString fromCode: code protoco
188198
ifTrue: [ self generateAssertionsFor: model rootEntities anyOne containedEntities first pushing: 'fast rootEntities anyOne containedEntities first' popAtTheEnd: false ]
189199
ifFalse: [ self generateAssertionsFor: model rootEntities anyOne pushing: 'fast rootEntities anyOne' popAtTheEnd: false ].
190200

191-
self testCase compile: stream contents classified: protocol
201+
self generateMethod: stream contents inProtocol: protocol
192202
]
193203

194204
{ #category : 'initialization' }

0 commit comments

Comments
 (0)