Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added non-strict-mode that allows runs even with failing tests #29

Closed
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
37 changes: 34 additions & 3 deletions src/MuTalk-Model/MutationTestingAnalysis.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Class {
'mutations',
'testCases',
'coverageAnalysisResult',
'logger'
'logger',
'beStrictMode'
],
#category : #'MuTalk-Model'
}
Expand Down Expand Up @@ -180,6 +181,12 @@ MutationTestingAnalysis class >> testCasesReferencesFrom: testClass [
in: testClass ]
]

{ #category : #accessing }
MutationTestingAnalysis >> beStrictMode: aBoolean [

beStrictMode := aBoolean
]

{ #category : #accesing }
MutationTestingAnalysis >> coverageAnalysisResult [

Expand Down Expand Up @@ -231,7 +238,30 @@ MutationTestingAnalysis >> initialTestRun [

"Do an initial run of the tests to check that they are all green.
Only green tests count for the mutation testing analysis"
testCases do: [ :aTestCase | aTestCase runChecked ]
[ testCases do: [ :aTestCase | aTestCase runChecked ] ]
on: TestsWithErrorsException
do: [ :ex |
beStrictMode
ifTrue: [ ^ ex pass ]
ifFalse: [self initialTestRunNonStricMode ].
ex return: true ]
]

{ #category : #running }
MutationTestingAnalysis >> initialTestRunNonStricMode [
"In case that beStricMode is false, it will filter the passed tests"

| initialTestCases countFailingTests |
initialTestCases := testCases size.

self testCases: (testCases select: [ :aTestCase |
aTestCase testCase run runCount
= aTestCase testCase run passedCount ]).

countFailingTests := initialTestCases - testCases size.
countFailingTests > 0 ifTrue: [
self inform: 'Your have ' , countFailingTests printString ,
' test(s) that have Errors or Failures. But in Non-Strict-Mode I will filter them' ]
]

{ #category : #'initialize-release' }
Expand All @@ -243,7 +273,8 @@ MutationTestingAnalysis >> initializeFor: someTestCasesReferences mutating: some
mutantsEvaluationStrategy := aMutantsEvaluationStrategy.
particularResults := OrderedCollection new.
elapsedTime := 0.
logger := aLogger
logger := aLogger.
beStrictMode := true.
]

{ #category : #accesing }
Expand Down
Loading