From fba74ed351216f1f647a10ab203ca96e1d32b9cf Mon Sep 17 00:00:00 2001 From: Durieux Pol Date: Tue, 16 Apr 2024 14:03:15 +0200 Subject: [PATCH] lazy initialization --- src/MuTalk-Model/MTAnalysis.class.st | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/MuTalk-Model/MTAnalysis.class.st b/src/MuTalk-Model/MTAnalysis.class.st index 6493a33..0378680 100644 --- a/src/MuTalk-Model/MTAnalysis.class.st +++ b/src/MuTalk-Model/MTAnalysis.class.st @@ -160,9 +160,8 @@ MTAnalysis >> initialTestRun [ | results | results := testCases collect: [ :aTestCase | aTestCase run ]. - "The test filter is initialized here because the default one needs the run time of tests, so the initial test run must be executed first" - self initializeTestFilter. - testFilter validateFailuresIn: results. + "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" + self testFilter validateFailuresIn: results. testCases := testFilter filterTests: testCases ] @@ -179,12 +178,6 @@ MTAnalysis >> initialize [ stopOnErrorOrFail := true ] -{ #category : 'initialization' } -MTAnalysis >> initializeTestFilter [ - - testFilter ifNil: [ testFilter := self defaultTestFilter ] -] - { #category : 'accessing' } MTAnalysis >> logger [ @@ -363,7 +356,7 @@ MTAnalysis >> testClasses: aClassCollection [ { #category : 'accessing' } MTAnalysis >> testFilter [ - ^ testFilter + ^ testFilter ifNil: [ testFilter := self defaultTestFilter ] ] { #category : 'accessing' }