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
17 changes: 11 additions & 6 deletions src/MuTalk-Model/MTAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,10 @@ MTAnalysis >> initialTestRun [
| results |
logger logStartInitialTestRun: testCases size.
results := testCases collect: [ :aTestCase | aTestCase run ].
logger logEndInitialTestRun.

logger logEndInitialTestRun.
"The test filter is initialized lazily here because the default one needs the run time of tests, so the initial test run must be executed first"
testCases := self testFilter filterTests: testCases.
(testCases anySatisfy: [ :testCase |
self testFilter failuresOrErrorsIn: testCase ]) ifTrue: [
MTTestsWithErrorsException signal ]
self initializeTestFilter
]

{ #category : 'initialization' }
Expand All @@ -202,6 +199,14 @@ MTAnalysis >> initialize [
warnAboutEmptyTests := true
]

{ #category : 'initialization' }
MTAnalysis >> initializeTestFilter [

testCases := self testFilter filterTests: testCases.
(testCases anySatisfy: [ :testCase | self testFilter failuresOrErrorsIn: testCase ]) ifTrue: [
MTTestsWithErrorsException signal ]
]

{ #category : 'accessing' }
MTAnalysis >> logger [

Expand Down
2 changes: 1 addition & 1 deletion src/MuTalk-Model/MTMessageSendToYourselfOperator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ MTMessageSendToYourselfOperator >> newNodeFrom: anOldNode [

| nodeCopy |
nodeCopy := anOldNode copy.
^ RBMessageNode receiver: nodeCopy receiver selector: #yourself
^ RBMessageNode receiver: nodeCopy receiver selector: (RBSelectorNode value: #yourself)
]
26 changes: 22 additions & 4 deletions src/MuTalk-Model/MTMethodInstaller.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Class {
#name : 'MTMethodInstaller',
#superclass : 'Object',
#instVars : [
'text'
],
#category : 'MuTalk-Model-Core',
#package : 'MuTalk-Model',
#tag : 'Core'
Expand All @@ -20,8 +23,9 @@ MTMethodInstaller >> installFromSource: aSourceCode in: aClass [
"Install a SourceCode in aClass. Raise exception in case de installation is
not posible."

[ aClass compile: aSourceCode ]
on: Error , SyntaxErrorNotification
text := aSourceCode.
[ aClass compile: aSourceCode notifying: self ]
on: Error
do: [ :error | MTMethodInstallerException signal ]
]

Expand All @@ -30,11 +34,25 @@ MTMethodInstaller >> installFromSourceSilently: aSourceCode in: aClass [
"Install a SourceCode in aClass. Raise exception in case de installation is
not posible."

[ aClass compileSilently: aSourceCode ]
on: Error , SyntaxErrorNotification
text := aSourceCode.
[ aClass compileSilently: aSourceCode classified: 'test' notifying: self ]
on: Error
do: [ :error | MTMethodInstallerException signal ]
]

{ #category : 'installing' }
MTMethodInstaller >> notify: aString at: anInteger in: code [

self error: aString , ' at: ' , anInteger asString , ' in: ' , code
]

{ #category : 'accessing' }
MTMethodInstaller >> text [
"This method is here only for compatibility with Pharo 9 without impacting Pharo 14+"

^ text
]

{ #category : 'installing' }
MTMethodInstaller >> uninstall: aSelector from: aClass [
"Uninstall a method referenced by aSelector in aClass. Raise exception in
Expand Down
18 changes: 18 additions & 0 deletions src/MuTalk-Model/MTTestCaseReference.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Class {
#tag : 'Core'
}

{ #category : 'accessing' }
MTTestCaseReference class >> announcer [

^ self testCase announcer
]

{ #category : 'instance creation' }
MTTestCaseReference class >> for: aTestCase [

Expand All @@ -33,6 +39,12 @@ MTTestCaseReference >> = anObject [
^ self selector = anObject selector
]

{ #category : 'private' }
MTTestCaseReference >> cleanAfterRunOn: aTestSuite [

testCase cleanAfterRunOn: aTestSuite
]

{ #category : 'defaults' }
MTTestCaseReference >> defaultLogger [

Expand Down Expand Up @@ -95,6 +107,12 @@ MTTestCaseReference >> method [
^ testCase class >> testCase selector
]

{ #category : 'private' }
MTTestCaseReference >> prepareToRunOn: aTestSuite [

testCase prepareToRunOn: aTestSuite
]

{ #category : 'printing' }
MTTestCaseReference >> printOn: aStream [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ MTMessageSendArguments1stNullifierOperatorTest >> newNodeOneSender [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #at:put:
selector: (RBSelectorNode value: #at:put:)
arguments: {
(RBLiteralValueNode value: nil).
(RBLiteralValueNode value: 2) }
Expand All @@ -70,7 +70,7 @@ MTMessageSendArguments1stNullifierOperatorTest >> newNodeTwoSendersFirst [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #at:put:
selector: (RBSelectorNode value: #at:put:)
arguments: {
(RBLiteralValueNode value: nil).
(RBLiteralValueNode value: 2) }
Expand All @@ -81,7 +81,7 @@ MTMessageSendArguments1stNullifierOperatorTest >> newNodeTwoSendersSecond [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #at:
selector: (RBSelectorNode value: #at:)
arguments: { (RBLiteralValueNode value: nil) }
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ MTMessageSendArguments3rdNullifierOperatorTest >> newNodeOneSender [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #collect:from:to:
selector: (RBSelectorNode value: #collect:from:to:)
arguments: {
(RBBlockNode
arguments: { (RBVariableNode named: #s) }
Expand All @@ -83,7 +83,7 @@ MTMessageSendArguments3rdNullifierOperatorTest >> newNodeTwoSendersFirst [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #collect:from:to:
selector: (RBSelectorNode value: #collect:from:to:)
arguments: {
(RBBlockNode
arguments: { (RBVariableNode named: #s) }
Expand All @@ -98,7 +98,7 @@ MTMessageSendArguments3rdNullifierOperatorTest >> newNodeTwoSendersSecond [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #collect:from:to:
selector: (RBSelectorNode value: #collect:from:to:)
arguments: {
(RBBlockNode
arguments: { (RBVariableNode named: #s) }
Expand Down
6 changes: 3 additions & 3 deletions src/MuTalk-Tests/MTMessageSendToYourselfOperatorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ MTMessageSendToYourselfOperatorTest >> newNodeOneSender [

^ RBSequenceNode statements: { (RBMessageNode
receiver: (RBVariableNode named: #self)
selector: #yourself) }
selector: (RBSelectorNode value: #yourself)) }
]

{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> newNodeTwoSendersFirst [

^ RBSequenceNode statements: { (RBMessageNode
receiver: (RBVariableNode named: #Dictionary)
selector: #yourself) }
selector: (RBSelectorNode value: #yourself)) }
]

{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> newNodeTwoSendersSecond [

^ RBSequenceNode statements: { (RBMessageNode
receiver: (RBVariableNode named: #dict)
selector: #yourself) }
selector: (RBSelectorNode value: #yourself)) }
]

{ #category : 'accessing' }
Expand Down
Loading