Skip to content

Commit 4e51fa3

Browse files
committed
Merge 8f99e03
2 parents 513d75c + 8f99e03 commit 4e51fa3

5 files changed

+59
-9
lines changed

src/MuTalk-Model/MTAnalysis.class.st

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Class {
1414
'stopOnErrorOrFail',
1515
'testSelectionStrategy',
1616
'testFilter',
17-
'mutantGenerationStrategy'
17+
'mutantGenerationStrategy',
18+
'warnAboutEmptyTests'
1819
],
1920
#category : 'MuTalk-Model-Core',
2021
#package : 'MuTalk-Model',
@@ -105,6 +106,12 @@ MTAnalysis >> doNotStopOnErrorOrFail [
105106
stopOnErrorOrFail := false
106107
]
107108

109+
{ #category : 'accessing' }
110+
MTAnalysis >> doNotWarnAboutEmptyTests [
111+
112+
warnAboutEmptyTests := false
113+
]
114+
108115
{ #category : 'results' }
109116
MTAnalysis >> generalResult [
110117

@@ -191,7 +198,8 @@ MTAnalysis >> initialize [
191198
elapsedTime := 0.
192199
logger := self defaultLogger.
193200
stopOnErrorOrFail := true.
194-
budget := self defaultBudget
201+
budget := self defaultBudget.
202+
warnAboutEmptyTests := true
195203
]
196204

197205
{ #category : 'accessing' }
@@ -374,7 +382,7 @@ MTAnalysis >> testCasesFrom: aClassCollection [
374382
testCase addAll:
375383
(self testCasesReferencesFrom: testClass) ].
376384
testCase ].
377-
tests isEmpty ifTrue: [
385+
tests isEmpty & warnAboutEmptyTests ifTrue: [
378386
Warning signal: 'There is currently no tests' ].
379387
^ tests
380388
]

src/MuTalk-Model/MTProgressBarLogger.class.st

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Class {
1515
{ #category : 'initialization' }
1616
MTProgressBarLogger >> initialize [
1717

18+
self initializeMainJob
19+
]
20+
21+
{ #category : 'initialization' }
22+
MTProgressBarLogger >> initializeMainJob [
23+
1824
mainJob := Job new.
1925
SystemVersion current major <= 10 ifTrue: [
2026
"Jobs need a block below P10 to have an owner?"
@@ -75,6 +81,7 @@ MTProgressBarLogger >> initializeTestJob: size [
7581
{ #category : 'logging' }
7682
MTProgressBarLogger >> logAnalysisStart [
7783

84+
mainJob ifNil: [ self initializeMainJob ].
7885
mainJob prepareForRunning
7986
]
8087

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Extension { #name : 'MTAnalysis' }
2+
3+
{ #category : '*MuTalk-Utilities' }
4+
MTAnalysis >> generateHeatmap [
5+
6+
| matrix |
7+
matrix := MTMatrix new analysis: self.
8+
matrix generateHeatmap
9+
]
10+
11+
{ #category : '*MuTalk-Utilities' }
12+
MTAnalysis >> generateMatrix [
13+
14+
| matrix |
15+
matrix := MTMatrix new analysis: self.
16+
matrix generateMatrix
17+
]

src/MuTalk-Utilities/MTMatrix.class.st

+23-6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ MTMatrix >> analysis [
7676
^ analysis
7777
]
7878

79+
{ #category : 'accessing' }
80+
MTMatrix >> analysis: anAnalysis [
81+
82+
analysis := anAnalysis.
83+
testClasses := (anAnalysis testCases groupedBy: [ :testCase |
84+
testCase testCaseClass ]) keys.
85+
testCases := analysis testCases.
86+
mutations := analysis mutations.
87+
self fillMatrix
88+
]
89+
7990
{ #category : 'comparing' }
8091
MTMatrix >> booleanCollection1: collection1 equalsBooleanCollection2: collection2 [
8192

@@ -100,12 +111,7 @@ MTMatrix >> booleanCollection1: collection1 includesBooleanCollection2: collecti
100111
MTMatrix >> build [
101112

102113
self runAnalysis.
103-
mutations do: [ :mut |
104-
self
105-
at: mut
106-
put:
107-
(testCases collect: [ :test |
108-
(self failuresFor: mut) includes: test ]) ]
114+
self fillMatrix
109115
]
110116

111117
{ #category : 'accessing' }
@@ -195,6 +201,17 @@ MTMatrix >> failuresFor: aMutation andTestClass: aTestClass [
195201
testCase testCaseClass = aTestClass ]
196202
]
197203

204+
{ #category : 'building' }
205+
MTMatrix >> fillMatrix [
206+
207+
mutations do: [ :mut |
208+
self
209+
at: mut
210+
put:
211+
(testCases collect: [ :test |
212+
(self failuresFor: mut) includes: test ]) ]
213+
]
214+
198215
{ #category : 'rendering' }
199216
MTMatrix >> generateHeatmapWithMutationsGroupedBy: aBlock [
200217

src/MuTalk-Utilities/MTUtilityAnalysis.class.st

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ MTUtilityAnalysis >> initializeMtAnalysis [
4646
mtAnalysis ifNil: [
4747
mtAnalysis := MTAnalysis new
4848
classesToMutate: classes;
49+
doNotWarnAboutEmptyTests;
4950
testClasses: { } ]
5051
]
5152

0 commit comments

Comments
 (0)