Skip to content

Commit 623429e

Browse files
committed
removed warning catch & added parameter to tell whether to raise the warning or not
1 parent 6944346 commit 623429e

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-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' }
@@ -362,7 +370,7 @@ MTAnalysis >> testCasesFrom: aClassCollection [
362370
testCase addAll:
363371
(self testCasesReferencesFrom: testClass) ].
364372
testCase ].
365-
tests isEmpty ifTrue: [
373+
tests isEmpty & warnAboutEmptyTests ifTrue: [
366374
Warning signal: 'There is currently no tests' ].
367375
^ tests
368376
]

src/MuTalk-Utilities/MTUtilityAnalysis.class.st

+2-6
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,10 @@ MTUtilityAnalysis >> classes: anObject [
4444
MTUtilityAnalysis >> initializeMtAnalysis [
4545

4646
mtAnalysis ifNil: [
47-
[ mtAnalysis := MTAnalysis new
47+
mtAnalysis := MTAnalysis new
4848
classesToMutate: classes;
49+
doNotWarnAboutEmptyTests;
4950
testClasses: { } ]
50-
on: Warning
51-
do: [ :warning |
52-
warning messageText = 'There is currently no tests'
53-
ifTrue: [ warning resume ]
54-
ifFalse: [ warning signal ] ] ]
5551
]
5652

5753
{ #category : 'accessing' }

0 commit comments

Comments
 (0)