Skip to content

Commit ad184af

Browse files
authored
Merge pull request #81 from guillep/termination
Improve detection of terminated mutants
2 parents 11f7f26 + 73675ac commit ad184af

22 files changed

+195
-89
lines changed

src/MuTalk-Model/MTAnalysis.class.st

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Class {
1616
'mutantSelectionStrategy',
1717
'testFilter'
1818
],
19-
#category : 'MuTalk-Model',
20-
#package : 'MuTalk-Model'
19+
#category : 'MuTalk-Model-Core',
20+
#package : 'MuTalk-Model',
21+
#tag : 'Core'
2122
}
2223

2324
{ #category : 'defaults' }
@@ -655,7 +656,7 @@ MTAnalysis >> run [
655656
do: [ :ex |
656657
self inform:
657658
'Your tests have Errors or Failures. Please correct them.'.
658-
ex return: false ]
659+
false ]
659660
]
660661

661662
{ #category : 'accessing' }

src/MuTalk-Model/MTCoverageAnalysis.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ Class {
99
'currentTest',
1010
'testRunningElapsedTime'
1111
],
12-
#category : 'MuTalk-Model',
13-
#package : 'MuTalk-Model'
12+
#category : 'MuTalk-Model-Coverage',
13+
#package : 'MuTalk-Model',
14+
#tag : 'Coverage'
1415
}
1516

1617
{ #category : 'instance creation' }

src/MuTalk-Model/MTCoverageAnalysisResult.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Class {
66
'timeToRunTests',
77
'methodReferences'
88
],
9-
#category : 'MuTalk-Model',
10-
#package : 'MuTalk-Model'
9+
#category : 'MuTalk-Model-Coverage',
10+
#package : 'MuTalk-Model',
11+
#tag : 'Coverage'
1112
}
1213

1314
{ #category : 'instance creation' }

src/MuTalk-Model/MTCoverageTestSuiteSelector.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Class {
22
#name : 'MTCoverageTestSuiteSelector',
33
#superclass : 'Object',
4-
#category : 'MuTalk-Model',
5-
#package : 'MuTalk-Model'
4+
#category : 'MuTalk-Model-Coverage',
5+
#package : 'MuTalk-Model',
6+
#tag : 'Coverage'
67
}
78

89
{ #category : 'selecting' }

src/MuTalk-Model/MTGeneralResult.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Class {
55
'particularResults',
66
'elapsedTime'
77
],
8-
#category : 'MuTalk-Model',
9-
#package : 'MuTalk-Model'
8+
#category : 'MuTalk-Model-Core',
9+
#package : 'MuTalk-Model',
10+
#tag : 'Core'
1011
}
1112

1213
{ #category : 'instance creation' }

src/MuTalk-Model/MTInfiniteRecursionError.class.st

-30
This file was deleted.

src/MuTalk-Model/MTMethodInstaller.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Class {
22
#name : 'MTMethodInstaller',
33
#superclass : 'Object',
4-
#category : 'MuTalk-Model',
5-
#package : 'MuTalk-Model'
4+
#category : 'MuTalk-Model-Core',
5+
#package : 'MuTalk-Model',
6+
#tag : 'Core'
67
}
78

89
{ #category : 'installing' }
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Class {
22
#name : 'MTMethodInstallerException',
33
#superclass : 'Error',
4-
#category : 'MuTalk-Model',
5-
#package : 'MuTalk-Model'
4+
#category : 'MuTalk-Model-Core',
5+
#package : 'MuTalk-Model',
6+
#tag : 'Core'
67
}

src/MuTalk-Model/MTMethodMutation.class.st

+27-8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ Class {
1010
'originalProtocol',
1111
'data'
1212
],
13-
#category : 'MuTalk-Model',
14-
#package : 'MuTalk-Model'
13+
#category : 'MuTalk-Model-Core',
14+
#package : 'MuTalk-Model',
15+
#tag : 'Core'
1516
}
1617

1718
{ #category : 'instance creation' }
@@ -171,14 +172,32 @@ MTMethodMutation >> printOn: aStream [
171172
]
172173

173174
{ #category : 'running' }
174-
MTMethodMutation >> runMutantStoppingOnError: aBoolean [
175+
MTMethodMutation >> runMutantStoppingOnError: aBoolean in: anEvaluation [
175176

176-
| testResults |
177+
| testResults brokenTests |
178+
[
177179
EpMonitor disableDuring: [
178-
[ self install.
179-
testResults := self runTestsStoppingOnError: aBoolean
180-
] ensure: [ self uninstall ] ].
181-
^ testResults
180+
testResults := [
181+
self install.
182+
self runTestsStoppingOnError: aBoolean ] ensure: [
183+
self uninstall ] ] ]
184+
on: Error
185+
do: [ :error |
186+
^ MTMutantEvaluationResultTerminated
187+
newFor: self
188+
results: error freeze
189+
producedBy: anEvaluation ].
190+
191+
brokenTests := testResults errorsSize + testResults failuresSize.
192+
brokenTests = 0 ifTrue: [
193+
^ MTMutantEvaluationResultSurvived
194+
newFor: self
195+
results: testResults
196+
producedBy: anEvaluation ].
197+
^ MTMutantEvaluationResultKilled
198+
newFor: self
199+
results: testResults
200+
producedBy: anEvaluation
182201
]
183202

184203
{ #category : 'private' }

src/MuTalk-Model/MTMethodWrapperForCoverage.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Class {
55
'tests',
66
'coverageAnalysis'
77
],
8-
#category : 'MuTalk-Model',
9-
#package : 'MuTalk-Model'
8+
#category : 'MuTalk-Model-Coverage',
9+
#package : 'MuTalk-Model',
10+
#tag : 'Coverage'
1011
}
1112

1213
{ #category : 'instance creation' }

src/MuTalk-Model/MTMutantEvaluation.class.st

+4-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ Class {
77
'testCases',
88
'coverageAnalysisResult'
99
],
10-
#category : 'MuTalk-Model',
11-
#package : 'MuTalk-Model'
10+
#category : 'MuTalk-Model-Core',
11+
#package : 'MuTalk-Model',
12+
#tag : 'Core'
1213
}
1314

1415
{ #category : 'instance creation' }
@@ -76,14 +77,9 @@ MTMutantEvaluation >> testResults [
7677
{ #category : 'evaluation' }
7778
MTMutantEvaluation >> valueStoppingOnError: aBoolean [
7879

79-
| testResults |
8080
self initializeCoverageResultIfNil.
8181

8282
mutation testCaseReferences:
8383
(strategy testCasesToEvaluate: mutation for: self).
84-
testResults := mutation runMutantStoppingOnError: aBoolean.
85-
^ MTMutantEvaluationResult
86-
for: mutation
87-
results: testResults
88-
producedBy: self
84+
^ mutation runMutantStoppingOnError: aBoolean in: self
8985
]

src/MuTalk-Model/MTMutantKillingSuggestionGenerator.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Class {
22
#name : 'MTMutantKillingSuggestionGenerator',
33
#superclass : 'Object',
4-
#category : 'MuTalk-Model',
5-
#package : 'MuTalk-Model'
4+
#category : 'MuTalk-Model-Reporting',
5+
#package : 'MuTalk-Model',
6+
#tag : 'Reporting'
67
}
78

89
{ #category : 'evaluating' }

src/MuTalk-Model/MTMutantOperatorShouldNotBeAppliedException.class.st

-6
This file was deleted.

src/MuTalk-Model/MTTestCaseReference.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Class {
66
'selector',
77
'lastTimeToRun'
88
],
9-
#category : 'MuTalk-Model',
10-
#package : 'MuTalk-Model'
9+
#category : 'MuTalk-Model-Core',
10+
#package : 'MuTalk-Model',
11+
#tag : 'Core'
1112
}
1213

1314
{ #category : 'instance creation' }

src/MuTalk-Model/MTTestSuiteWrappedForCoverage.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Class {
44
#instVars : [
55
'coverageAnalysis'
66
],
7-
#category : 'MuTalk-Model',
8-
#package : 'MuTalk-Model'
7+
#category : 'MuTalk-Model-Coverage',
8+
#package : 'MuTalk-Model',
9+
#tag : 'Coverage'
910
}
1011

1112
{ #category : 'instance creation' }
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Class {
22
#name : 'MTTestsWithErrorsException',
33
#superclass : 'Error',
4-
#category : 'MuTalk-Model',
5-
#package : 'MuTalk-Model'
4+
#category : 'MuTalk-Model-Core',
5+
#package : 'MuTalk-Model',
6+
#tag : 'Core'
67
}

src/MuTalk-Model/ManifestMuTalkModel.class.st

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ I store metadata for this package. These meta data are used by other tools such
44
Class {
55
#name : 'ManifestMuTalkModel',
66
#superclass : 'PackageManifest',
7-
#category : 'MuTalk-Model',
8-
#package : 'MuTalk-Model'
7+
#category : 'MuTalk-Model-Core',
8+
#package : 'MuTalk-Model',
9+
#tag : 'Core'
910
}
1011

1112
{ #category : 'code-critics' }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Class {
2+
#name : 'MTFailedInstallMethodMutation',
3+
#superclass : 'MTMethodMutation',
4+
#category : 'MuTalk-Tests',
5+
#package : 'MuTalk-Tests'
6+
}
7+
8+
{ #category : 'installing' }
9+
MTFailedInstallMethodMutation >> install [
10+
11+
self error
12+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Class {
2+
#name : 'MTFailedRunMethodMutation',
3+
#superclass : 'MTMethodMutation',
4+
#category : 'MuTalk-Tests',
5+
#package : 'MuTalk-Tests'
6+
}
7+
8+
{ #category : 'private' }
9+
MTFailedRunMethodMutation >> runTestsStoppingOnError: aBoolean [
10+
11+
self error
12+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Class {
2+
#name : 'MTFailedUninstallMethodMutation',
3+
#superclass : 'MTMethodMutation',
4+
#category : 'MuTalk-Tests',
5+
#package : 'MuTalk-Tests'
6+
}
7+
8+
{ #category : 'installing' }
9+
MTFailedUninstallMethodMutation >> uninstall [
10+
11+
self error
12+
]

0 commit comments

Comments
 (0)