*** empty log message ***
authorsr
Tue, 09 Jul 2019 11:46:14 +0200
changeset 5530eb4fa6a03cc
parent 552 815a1b5f7135
child 554 0eff0d241487
*** empty log message ***
quickSelfTest/RunUnitTests.st
     1.1 --- a/quickSelfTest/RunUnitTests.st	Fri Jun 07 03:26:24 2019 +0000
     1.2 +++ b/quickSelfTest/RunUnitTests.st	Tue Jul 09 11:46:14 2019 +0200
     1.3 @@ -75,58 +75,58 @@
     1.4  
     1.5      index := arguments indexOf:'--settingsFile'.
     1.6      index > 0 ifTrue:[
     1.7 -        settingsFilePathName := arguments at:index + 1.
     1.8 -        self logInfo:'load settings file: %1' with:settingsFilePathName.
     1.9 -        settingsFilePathName asFilename fileIn.
    1.10 -        self logInfo:'makeCommand (from ParserFlags) is: %1' with:(ParserFlags makeCommand).
    1.11 +	settingsFilePathName := arguments at:index + 1.
    1.12 +	self logInfo:'load settings file: %1' with:settingsFilePathName.
    1.13 +	settingsFilePathName asFilename fileIn.
    1.14 +	self logInfo:'makeCommand (from ParserFlags) is: %1' with:(ParserFlags makeCommand).
    1.15      ].
    1.16  
    1.17      (arguments includes:'--runOnlyExpeccoUnitTests') ifTrue:[
    1.18 -        self logInfo:'configured to run expecco unit tests only'.
    1.19 -        doRunSpecificUnitTests := true.
    1.20 -        unitTestSuiteName := 'expecco Unit Tests'.
    1.21 -        excludedUnitTestClassNames := self excludedUnitTestClassNamesForExpecco.
    1.22 +	self logInfo:'configured to run expecco unit tests only'.
    1.23 +	doRunSpecificUnitTests := true.
    1.24 +	unitTestSuiteName := 'expecco Unit Tests'.
    1.25 +	excludedUnitTestClassNames := self excludedUnitTestClassNamesForExpecco.
    1.26      ].
    1.27  
    1.28      index := arguments indexOf:'--resultFile'.
    1.29      index > 0 ifTrue:[
    1.30 -        resultFilePathName := arguments at:index + 1.
    1.31 -        self logInfo:'set custom result file: %1' with:resultFilePathName.
    1.32 +	resultFilePathName := arguments at:index + 1.
    1.33 +	self logInfo:'set custom result file: %1' with:resultFilePathName.
    1.34      ].
    1.35  
    1.36      [
    1.37 -        (index := arguments indexOf:'--run') > 0
    1.38 +	(index := arguments indexOf:'--run') > 0
    1.39      ] whileTrue:[
    1.40 -        runTestCases add:(arguments at:index + 1).
    1.41 -        self logInfo:'run test: "%1"' with:(arguments at:index + 1).
    1.42 -        arguments removeIndex:index + 1.
    1.43 -        arguments removeIndex:index.
    1.44 +	runTestCases add:(arguments at:index + 1).
    1.45 +	self logInfo:'run test: "%1"' with:(arguments at:index + 1).
    1.46 +	arguments removeIndex:index + 1.
    1.47 +	arguments removeIndex:index.
    1.48      ].
    1.49  
    1.50      [
    1.51 -        (index := arguments indexOf:'--exclude') > 0
    1.52 +	(index := arguments indexOf:'--exclude') > 0
    1.53      ] whileTrue:[
    1.54 -        excludedUnitTestClassNames add:(arguments at:index + 1).
    1.55 -        self logInfo:'exclude test: "%1"' with:(arguments at:index + 1).
    1.56 -        arguments removeIndex:index + 1.
    1.57 -        arguments removeIndex:index.
    1.58 +	excludedUnitTestClassNames add:(arguments at:index + 1).
    1.59 +	self logInfo:'exclude test: "%1"' with:(arguments at:index + 1).
    1.60 +	arguments removeIndex:index + 1.
    1.61 +	arguments removeIndex:index.
    1.62      ].
    1.63  
    1.64      index := arguments indexOf:'--forceTestCase'.
    1.65      index > 0 ifTrue:[
    1.66 -        forceTestCase := arguments at:index + 1.
    1.67 -        self logInfo:'run single test (forceTestCase): "%1"' with:forceTestCase.
    1.68 +	forceTestCase := arguments at:index + 1.
    1.69 +	self logInfo:'run single test (forceTestCase): "%1"' with:forceTestCase.
    1.70      ].
    1.71  
    1.72      index := arguments indexOf:'--testRunner'.
    1.73      index > 0 ifTrue:[
    1.74 -        arguments removeIndex:index.
    1.75 -        forceTestCase := #'RunUnitTests::RunnerSelfTest'.
    1.76 -        self logInfo:'execute runner self test'.
    1.77 +	arguments removeIndex:index.
    1.78 +	forceTestCase := #'RunUnitTests::RunnerSelfTest'.
    1.79 +	self logInfo:'execute runner self test'.
    1.80      ].
    1.81  
    1.82      (doRunSpecificUnitTests not and:[forceTestCase isNil]) ifTrue:[
    1.83 -        self logInfo:'configured to run all available unit tests'.
    1.84 +	self logInfo:'configured to run all available unit tests'.
    1.85      ].
    1.86  
    1.87      "/ self logInfo:'collecting tests to run'.
    1.88 @@ -136,115 +136,115 @@
    1.89      possibleClassNames add:#'RunUnitTests::RunnerSelfTest'.
    1.90  
    1.91      possibleClassNames do:[:eachClassName |
    1.92 -        (excludedUnitTestClassNames includes:eachClassName) ifTrue:[
    1.93 -            self logInfo:'exclude test "%1".' with:eachClassName.
    1.94 -        ] ifFalse:[
    1.95 -            (runTestCases notEmptyOrNil and:[(runTestCases includes:eachClassName) not]) ifTrue:[
    1.96 -                self logInfo:'not selected: "%1".' with:eachClassName.
    1.97 -            ] ifFalse:[
    1.98 -                (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[
    1.99 -                    self logWarning:'test "%1" is marked as corrupted, please fix' with:eachClassName.
   1.100 -                ] ifFalse:[
   1.101 -                    (eachClassName notNil
   1.102 -                    and:[
   1.103 -                        "/ skip non test class classes
   1.104 -                        (#(
   1.105 -                            'stx_goodies_regression'
   1.106 -                        ) includes:eachClassName) not
   1.107 -                    and:[
   1.108 -                        forceTestCase isNil
   1.109 -                        or:[forceTestCase = eachClassName
   1.110 -                        or:[forceTestCase = ((eachClassName subStrings:'::') lastIfEmpty:nil)]]
   1.111 -                    ]]) ifTrue:[
   1.112 -                        eachClass := Smalltalk at:eachClassName.
   1.113 +	(excludedUnitTestClassNames includes:eachClassName) ifTrue:[
   1.114 +	    self logInfo:'exclude test "%1".' with:eachClassName.
   1.115 +	] ifFalse:[
   1.116 +	    (runTestCases notEmptyOrNil and:[(runTestCases includes:eachClassName) not]) ifTrue:[
   1.117 +		self logInfo:'not selected: "%1".' with:eachClassName.
   1.118 +	    ] ifFalse:[
   1.119 +		(corruptedUnitTestClassNames includes:eachClassName) ifTrue:[
   1.120 +		    self logWarning:'test "%1" is marked as corrupted, please fix' with:eachClassName.
   1.121 +		] ifFalse:[
   1.122 +		    (eachClassName notNil
   1.123 +		    and:[
   1.124 +			"/ skip non test class classes
   1.125 +			(#(
   1.126 +			    'stx_goodies_regression'
   1.127 +			) includes:eachClassName) not
   1.128 +		    and:[
   1.129 +			forceTestCase isNil
   1.130 +			or:[forceTestCase = eachClassName
   1.131 +			or:[forceTestCase = ((eachClassName subStrings:'::') lastIfEmpty:nil)]]
   1.132 +		    ]]) ifTrue:[
   1.133 +			eachClass := Smalltalk at:eachClassName.
   1.134  
   1.135 -                        useCompiledUnitTestClasses ifFalse:[
   1.136 -                            "here we want to test the jitter code
   1.137 -                             therfore we file in, exit if the class is already present somwhow"
   1.138 -                            eachClass notNil ifTrue:[
   1.139 -                                self logWarning:'test class "%1" was already present as stc-compiled class before file in.' with:eachClassName.
   1.140 -                                Smalltalk isSmalltalkDevelopmentSystem ifFalse:[
   1.141 -                                    Smalltalk exit:1.
   1.142 -                                ].
   1.143 -                            ].
   1.144 +			useCompiledUnitTestClasses ifFalse:[
   1.145 +			    "here we want to test the jitter code
   1.146 +			     therfore we file in, exit if the class is already present somwhow"
   1.147 +			    eachClass notNil ifTrue:[
   1.148 +				self logWarning:'test class "%1" was already present as stc-compiled class before file in.' with:eachClassName.
   1.149 +				Smalltalk isSmalltalkDevelopmentSystem ifFalse:[
   1.150 +				    Smalltalk exit:1.
   1.151 +				].
   1.152 +			    ].
   1.153  
   1.154 -                            eachClass := Smalltalk
   1.155 -                                fileInClass:eachClassName
   1.156 -                                package:'stx:goodies/regression'.
   1.157 -                        ].
   1.158 +			    eachClass := Smalltalk
   1.159 +				fileInClass:eachClassName
   1.160 +				package:'stx:goodies/regression'.
   1.161 +			].
   1.162  
   1.163 -                        eachClass notNil ifTrue:[
   1.164 -                            (eachClass isTestCaseLike
   1.165 -                            and:[eachClass isAbstract not]) ifTrue:[
   1.166 -                                self logInfo:'added test "%1".' with:eachClassName.
   1.167 -                                unitTestSuite addTest:eachClass suite.
   1.168 -                            ] ifFalse:[
   1.169 -                                self logInfo:'not a test "%1" (abstract or something else).'
   1.170 -                                        with:eachClassName.
   1.171 -                            ].
   1.172 -                        ] ifFalse:[
   1.173 -                            self logWarning:'test class "%1" is not loaded.' with:eachClassName.
   1.174 -                        ].
   1.175 -                    ] ifFalse:[
   1.176 -                        self logInfo:'skipped test "%1".' with:eachClassName.
   1.177 -                    ].
   1.178 -                ].
   1.179 -            ].
   1.180 -        ].
   1.181 +			eachClass notNil ifTrue:[
   1.182 +			    (eachClass isTestCaseLike
   1.183 +			    and:[eachClass isAbstract not]) ifTrue:[
   1.184 +				self logInfo:'added test "%1".' with:eachClassName.
   1.185 +				unitTestSuite addTest:eachClass suite.
   1.186 +			    ] ifFalse:[
   1.187 +				self logInfo:'not a test "%1" (abstract or something else).'
   1.188 +					with:eachClassName.
   1.189 +			    ].
   1.190 +			] ifFalse:[
   1.191 +			    self logWarning:'test class "%1" is not loaded.' with:eachClassName.
   1.192 +			].
   1.193 +		    ] ifFalse:[
   1.194 +			self logInfo:'skipped test "%1".' with:eachClassName.
   1.195 +		    ].
   1.196 +		].
   1.197 +	    ].
   1.198 +	].
   1.199      ].
   1.200  
   1.201      self logInfo:'%1 unit test(s) collected' with:(unitTestSuite tests size).
   1.202  
   1.203      self logInfo:'start tests...'.
   1.204      [
   1.205 -        result :=
   1.206 -            unitTestSuite
   1.207 -                run:TestResultStX new
   1.208 -                beforeEachDo:[:test |
   1.209 -                    self logInfo:'Run "%1"' with:test printString
   1.210 -                ]
   1.211 -                afterEachDo:[:test :result|
   1.212 -                    |execTime status|
   1.213 +	result :=
   1.214 +	    unitTestSuite
   1.215 +		run:TestResultStX new
   1.216 +		beforeEachDo:[:test |
   1.217 +		    self logInfo:'Run "%1"' with:test printString
   1.218 +		]
   1.219 +		afterEachDo:[:test :result|
   1.220 +		    |execTime status|
   1.221  
   1.222 -                    execTime := result lastOutcome executionTimeDuration.
   1.223 -                    status := result lastOutcome result.
   1.224 -                    self logInfo:'   %1 (%2)' with:status with:execTime.
   1.225 -                    (status == TestResult stateFail or:[status == TestResult stateError]) ifTrue:[
   1.226 -                        self logInfo:'   ==================='.
   1.227 -                    ]
   1.228 -                ]
   1.229 -                debug:debug.
   1.230 +		    execTime := result lastOutcome executionTimeDuration.
   1.231 +		    status := result lastOutcome result.
   1.232 +		    self logInfo:'   %1 (%2)' with:status with:execTime.
   1.233 +		    (status == TestResult stateFail or:[status == TestResult stateError]) ifTrue:[
   1.234 +			self logInfo:'   ==================='.
   1.235 +		    ]
   1.236 +		]
   1.237 +		debug:debug.
   1.238      ] ifCurtailed:[
   1.239 -        self logWarning:'aborted in:.'.
   1.240 -        thisContext fullPrintAllOn:Stderr.
   1.241 +	self logWarning:'aborted in:.'.
   1.242 +	thisContext fullPrintAllOn:Stderr.
   1.243      ].
   1.244  
   1.245      self logInfo:'tests finished.'.
   1.246  
   1.247      self logInfo:'generating xml report...'.
   1.248      [
   1.249 -        TestResultReporter
   1.250 -            report:result
   1.251 -            format:#xml_jUnit
   1.252 -            as:(resultFilePathName ? 'testresult.xml').
   1.253 +	TestResultReporter
   1.254 +	    report:result
   1.255 +	    format:#xml_jUnit
   1.256 +	    as:(resultFilePathName ? 'testresult.xml').
   1.257      ] on:Error do:[:ex |
   1.258 -        self logWarning:'error while generating xml report: %1' with:ex description.
   1.259 -        self logWarning:'in: %1' with:(ex suspendedContext fullPrintAllString).
   1.260 -        Smalltalk isSmalltalkDevelopmentSystem ifFalse:[
   1.261 -            Smalltalk exit:1.
   1.262 -        ].
   1.263 +	self logWarning:'error while generating xml report: %1' with:ex description.
   1.264 +	self logWarning:'in: %1' with:(ex suspendedContext fullPrintAllString).
   1.265 +	Smalltalk isSmalltalkDevelopmentSystem ifFalse:[
   1.266 +	    Smalltalk exit:1.
   1.267 +	].
   1.268      ].
   1.269  
   1.270      self logInfo:'xml report generated in %1' with:(resultFilePathName ? 'testresult.xml') asFilename pathName.
   1.271  
   1.272      self logInfo:'Summary:'.
   1.273      self logInfo:('  %1 tests, %2 run (%3 skipped) / %4 passed, %5 failed, %6 errors'
   1.274 -                bindWith:result tests size
   1.275 -                with:result runCount
   1.276 -                with:result skippedCount
   1.277 -                with:result passedCount
   1.278 -                with:result failureCount
   1.279 -                with:result errorCount).
   1.280 +		bindWith:result tests size
   1.281 +		with:result runCount
   1.282 +		with:result skippedCount
   1.283 +		with:result passedCount
   1.284 +		with:result failureCount
   1.285 +		with:result errorCount).
   1.286      "/ self logInfo:'  exec. time: %1' with:(TimeDuration fromSeconds:result executionTime).
   1.287  
   1.288      "Modified (format): / 16-05-2018 / 13:59:47 / sr"
   1.289 @@ -269,9 +269,9 @@
   1.290      collection add:#'RegressionTests::SelectorNamespacesTests'.
   1.291  
   1.292      "now exclude architecture dependent stuff"
   1.293 -    (OperatingSystem isMSWINDOWSlike not 
   1.294 +    (OperatingSystem isMSWINDOWSlike not
   1.295      or:[ExternalAddress pointerSize = 8]) ifTrue:[
   1.296 -        collection add:#'RegressionTests::Win32OLETests'.
   1.297 +	collection add:#'RegressionTests::Win32OLETests'.
   1.298      ].
   1.299  
   1.300      ^ collection
   1.301 @@ -281,27 +281,28 @@
   1.302  
   1.303  excludedUnitTestClassNamesForExpecco
   1.304      ^ self excludedUnitTestClassNames
   1.305 -        , #(
   1.306 -            #'RegressionTests::VMCrashTestCase'
   1.307 -            #'RegressionTests::VMCrashTests'
   1.308 -            #'RegressionTests::ParserTests'
   1.309 -            #'RegressionTests::BreakpointTests'
   1.310 -            #'RegressionTests::SunitXMLOutputTest'
   1.311 -            #'RegressionTests::CompilerTests2'
   1.312 -            #'RegressionTests::BehaviorLookupObjectTests'
   1.313 -            #'RegressionTests::ChangeSetTests'
   1.314 -            #'RegressionTests::MakefileTests'
   1.315 -            #'RegressionTests::MetaphoneStringComparatorTest'
   1.316 -            #'RegressionTests::STCCompilerTests'
   1.317 -            #'RegressionTests::VMCrashTests'
   1.318 -            #'RegressionTests::SnapshotRestartTests'
   1.319 -            #'RegressionTests::GraphicDrawingTest'
   1.320 -            #'RegressionTests::OS_OLE_Tests'
   1.321 -            #'RegressionTests::ExternalInterfaceTests'
   1.322 -            #'RegressionTests::DebuggerTest'
   1.323 -            #'RegressionTests::ContextTest2'
   1.324 -            #'RegressionTests::QDoubleTests'
   1.325 -        )
   1.326 +	, #(
   1.327 +	    #'RegressionTests::VMCrashTestCase'
   1.328 +	    #'RegressionTests::VMCrashTests'
   1.329 +	    #'RegressionTests::ParserTests'
   1.330 +	    #'RegressionTests::BreakpointTests'
   1.331 +	    #'RegressionTests::SunitXMLOutputTest'
   1.332 +	    #'RegressionTests::CompilerTests2'
   1.333 +	    #'RegressionTests::BehaviorLookupObjectTests'
   1.334 +	    #'RegressionTests::ChangeSetTests'
   1.335 +	    #'RegressionTests::MakefileTests'
   1.336 +	    #'RegressionTests::MetaphoneStringComparatorTest'
   1.337 +	    #'RegressionTests::STCCompilerTests'
   1.338 +	    #'RegressionTests::VMCrashTests'
   1.339 +	    #'RegressionTests::SnapshotRestartTests'
   1.340 +	    #'RegressionTests::GraphicDrawingTest'
   1.341 +	    #'RegressionTests::OS_OLE_Tests'
   1.342 +	    #'RegressionTests::ExternalInterfaceTests'
   1.343 +	    #'RegressionTests::DebuggerTest'
   1.344 +	    #'RegressionTests::ContextTest2'
   1.345 +	    #'RegressionTests::QDoubleTests'
   1.346 +	    #'RegressionTests::LargeFloatTest'
   1.347 +	)
   1.348  
   1.349      "Modified: / 06-06-2019 / 10:02:54 / Stefan Reise"
   1.350  ! !
   1.351 @@ -465,4 +466,3 @@
   1.352  version_CVS
   1.353      ^ '$Header$'
   1.354  ! !
   1.355 -