*** empty log message ***
authorStefan Vogel <sv@exept.de>
Fri, 11 May 2018 16:42:39 +0200
changeset 51506436c1b24f6
parent 514 f50803f4bb59
child 516 f0cf7d35ee5f
*** empty log message ***
quickSelfTest/RunUnitTests.st
     1.1 --- a/quickSelfTest/RunUnitTests.st	Wed Mar 07 23:14:09 2018 +0100
     1.2 +++ b/quickSelfTest/RunUnitTests.st	Fri May 11 16:42:39 2018 +0200
     1.3 @@ -39,18 +39,18 @@
     1.4      |cmdArgs|
     1.5  
     1.6      cmdArgs := Smalltalk commandLineArguments.
     1.7 -    
     1.8 -    self 
     1.9 -        runWithCompiledUnitTestClasses:useCompiledUnitTestClasses
    1.10 -        arguments:cmdArgs
    1.11 -        debug:(cmdArgs includes:'--debug')
    1.12 +
    1.13 +    self
    1.14 +	runWithCompiledUnitTestClasses:useCompiledUnitTestClasses
    1.15 +	arguments:cmdArgs
    1.16 +	debug:(cmdArgs includes:'--debug')
    1.17  !
    1.18  
    1.19  runWithCompiledUnitTestClasses:useCompiledUnitTestClasses
    1.20      arguments:arguments
    1.21      debug:debug
    1.22  
    1.23 -    |doRunSpecificUnitTests unitTestSuiteName excludedUnitTestClassNames corruptedUnitTestClassNames
    1.24 +    |doRunSpecificUnitTests unitTestSuiteName excludedUnitTestClassNames b
    1.25       unitTestSuite
    1.26       eachClass
    1.27       result index
    1.28 @@ -63,121 +63,121 @@
    1.29  
    1.30      index := arguments indexOf:'--settingsFile'.
    1.31      index > 0 ifTrue:[
    1.32 -        settingsFilePathName := arguments at:index + 1.
    1.33 -        self logInfo:'load settings file: ', settingsFilePathName printString.
    1.34 -        settingsFilePathName asFilename fileIn.
    1.35 -        self logInfo:'ParserFlags makeCommand: ', ParserFlags makeCommand printString.
    1.36 +	settingsFilePathName := arguments at:index + 1.
    1.37 +	self logInfo:'load settings file: ', settingsFilePathName printString.
    1.38 +	settingsFilePathName asFilename fileIn.
    1.39 +	self logInfo:'ParserFlags makeCommand: ', ParserFlags makeCommand printString.
    1.40      ].
    1.41  
    1.42      (arguments includes:'--runOnlyExpeccoUnitTests') ifTrue:[
    1.43 -        self logInfo:'configured to run expecco unit tests only'.
    1.44 -        doRunSpecificUnitTests := true.
    1.45 -        unitTestSuiteName := 'expecco Unit Tests'.
    1.46 -        excludedUnitTestClassNames := self excludedUnitTestClassNamesForExpecco.
    1.47 +	self logInfo:'configured to run expecco unit tests only'.
    1.48 +	doRunSpecificUnitTests := true.
    1.49 +	unitTestSuiteName := 'expecco Unit Tests'.
    1.50 +	excludedUnitTestClassNames := self excludedUnitTestClassNamesForExpecco.
    1.51      ].
    1.52  
    1.53      index := arguments indexOf:'--resultFile'.
    1.54      index > 0 ifTrue:[
    1.55 -        resultFilePathName := arguments at:index + 1.
    1.56 -        self logInfo:'set custom result file: ', resultFilePathName printString.
    1.57 +	resultFilePathName := arguments at:index + 1.
    1.58 +	self logInfo:'set custom result file: ', resultFilePathName printString.
    1.59      ].
    1.60  
    1.61      index := arguments indexOf:'--forceTestCase'.
    1.62      index > 0 ifTrue:[
    1.63 -        forceTestCase := arguments at:index + 1.
    1.64 -        self logInfo:'set force test case: ', forceTestCase printString.
    1.65 +	forceTestCase := arguments at:index + 1.
    1.66 +	self logInfo:'set force test case: ', forceTestCase printString.
    1.67      ].
    1.68  
    1.69      doRunSpecificUnitTests ifFalse:[
    1.70 -        self logInfo:'configured to run all available unit tests'.
    1.71 +	self logInfo:'configured to run all available unit tests'.
    1.72      ].
    1.73  
    1.74      self logInfo:'collecting unit test classes to run'.
    1.75      unitTestSuite := TestSuite named:unitTestSuiteName.
    1.76  
    1.77      (Smalltalk at: #'stx_goodies_regression') classNames do:[:eachClassName |
    1.78 -        (excludedUnitTestClassNames includes:eachClassName) ifTrue:[
    1.79 -            self
    1.80 -                logInfo:('excluded unit test class "%1".'
    1.81 -                    bindWith:eachClassName).
    1.82 -        ] ifFalse:[
    1.83 -            (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[
    1.84 -                self
    1.85 -                    logWarning:('corrupted unit test class detected, please fix #%1'
    1.86 -                        bindWith:eachClassName).
    1.87 -            ] ifFalse:[
    1.88 -                (eachClassName notNil
    1.89 -                and:[
    1.90 -                    "/ skip non test case classes
    1.91 -                    (#(
    1.92 -                        'stx_goodies_regression'
    1.93 -                    ) includes:eachClassName) not
    1.94 -                and:[
    1.95 -                    forceTestCase isNil
    1.96 -                    or:[forceTestCase = eachClassName
    1.97 -                    or:[forceTestCase = ((eachClassName subStrings:'::') lastIfEmpty:nil)]]
    1.98 -                ]]) ifTrue:[
    1.99 -                    eachClass := Smalltalk at:eachClassName.
   1.100 +	(excludedUnitTestClassNames includes:eachClassName) ifTrue:[
   1.101 +	    self
   1.102 +		logInfo:('excluded unit test class "%1".'
   1.103 +		    bindWith:eachClassName).
   1.104 +	] ifFalse:[
   1.105 +	    (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[
   1.106 +		self
   1.107 +		    logWarning:('RunUnitTest: unit test class is marked as corrupted, please fix #%1'
   1.108 +			bindWith:eachClassName).
   1.109 +	    ] ifFalse:[
   1.110 +		(eachClassName notNil
   1.111 +		and:[
   1.112 +		    "/ skip non test case classes
   1.113 +		    (#(
   1.114 +			'stx_goodies_regression'
   1.115 +		    ) includes:eachClassName) not
   1.116 +		and:[
   1.117 +		    forceTestCase isNil
   1.118 +		    or:[forceTestCase = eachClassName
   1.119 +		    or:[forceTestCase = ((eachClassName subStrings:'::') lastIfEmpty:nil)]]
   1.120 +		]]) ifTrue:[
   1.121 +		    eachClass := Smalltalk at:eachClassName.
   1.122  
   1.123 -                    useCompiledUnitTestClasses ifFalse:[
   1.124 -                        "here we want test the jitter code
   1.125 -                         therfor we file in, exit if the class is already present somwhow"
   1.126 -                        eachClass notNil ifTrue:[
   1.127 -                            self
   1.128 -                                logWarning:('Unit test class "%1" was already present before file in.'
   1.129 -                                    bindWith:eachClassName).
   1.130 +		    useCompiledUnitTestClasses ifFalse:[
   1.131 +			"here we want test the jitter code
   1.132 +			 therfor we file in, exit if the class is already present somwhow"
   1.133 +			eachClass notNil ifTrue:[
   1.134 +			    self
   1.135 +				logWarning:('Unit test class "%1" was already present before file in.'
   1.136 +				    bindWith:eachClassName).
   1.137  
   1.138 -                            Smalltalk exit:1.
   1.139 -                        ].
   1.140 +			    Smalltalk exit:1.
   1.141 +			].
   1.142  
   1.143 -                        eachClass := Smalltalk
   1.144 -                            fileInClass:eachClassName
   1.145 -                            package:'stx:goodies/regression'.
   1.146 -                    ].
   1.147 +			eachClass := Smalltalk
   1.148 +			    fileInClass:eachClassName
   1.149 +			    package:'stx:goodies/regression'.
   1.150 +		    ].
   1.151  
   1.152 -                    eachClass notNil ifTrue:[
   1.153 -                        (eachClass isTestCaseLike
   1.154 -                        and:[eachClass isAbstract not]) ifTrue:[
   1.155 -                            self
   1.156 -                                logInfo:('added unit test class "%1".'
   1.157 -                                    bindWith:eachClassName).
   1.158 +		    eachClass notNil ifTrue:[
   1.159 +			(eachClass isTestCaseLike
   1.160 +			and:[eachClass isAbstract not]) ifTrue:[
   1.161 +			    self
   1.162 +				logInfo:('added unit test class "%1".'
   1.163 +				    bindWith:eachClassName).
   1.164  
   1.165 -                            unitTestSuite addTest:eachClass suite.
   1.166 -                        ] ifFalse:[
   1.167 -                            self
   1.168 -                                logInfo:('not a unit test class "%1" (class is abstract or something else).'
   1.169 -                                    bindWith:eachClassName).
   1.170 -                        ].
   1.171 -                    ] ifFalse:[
   1.172 -                        self
   1.173 -                            logWarning:('unit test class "%1" is not loaded.'
   1.174 -                                bindWith:eachClassName).
   1.175 -                    ].
   1.176 -                ] ifFalse:[
   1.177 -                    self
   1.178 -                        logInfo:('skipped unit test class "%1".'
   1.179 -                            bindWith:eachClassName).
   1.180 -                ].
   1.181 -            ].
   1.182 -        ].
   1.183 +			    unitTestSuite addTest:eachClass suite.
   1.184 +			] ifFalse:[
   1.185 +			    self
   1.186 +				logInfo:('not a unit test class "%1" (class is abstract or something else).'
   1.187 +				    bindWith:eachClassName).
   1.188 +			].
   1.189 +		    ] ifFalse:[
   1.190 +			self
   1.191 +			    logWarning:('unit test class "%1" is not loaded.'
   1.192 +				bindWith:eachClassName).
   1.193 +		    ].
   1.194 +		] ifFalse:[
   1.195 +		    self
   1.196 +			logInfo:('skipped unit test class "%1".'
   1.197 +			    bindWith:eachClassName).
   1.198 +		].
   1.199 +	    ].
   1.200 +	].
   1.201      ].
   1.202  
   1.203      self
   1.204 -        logInfo:('%1 unit test classes collected'
   1.205 -            bindWith:unitTestSuite tests size).
   1.206 +	logInfo:('%1 unit test classes collected'
   1.207 +	    bindWith:unitTestSuite tests size).
   1.208  
   1.209      self logInfo:'starting unit tests'.
   1.210      result := unitTestSuite
   1.211 -        run:TestResultStX new
   1.212 -        beforeEachDo:[:test | self logInfo:'performing unit test ', test printString]
   1.213 -        afterEachDo:[:test| ]
   1.214 -        debug:debug.
   1.215 +	run:TestResultStX new
   1.216 +	beforeEachDo:[:test | self logInfo:'performing unit test ', test printString]
   1.217 +	afterEachDo:[:test| ]
   1.218 +	debug:debug.
   1.219  
   1.220      self logInfo:'generating report'.
   1.221      TestResultReporter
   1.222 -        report:result
   1.223 -        format:#xml_jUnit
   1.224 -        as:resultFilePathName ? 'testresult.xml'.
   1.225 +	report:result
   1.226 +	format:#xml_jUnit
   1.227 +	as:resultFilePathName ? 'testresult.xml'.
   1.228  
   1.229      self logInfo:'summary:'.
   1.230      self logInfo:('%1 tests' bindWith:result runCount).
   1.231 @@ -191,7 +191,6 @@
   1.232  corruptedUnitTestClassNames
   1.233      ^ #(
   1.234  	#'RegressionTests::ExternalInterfaceTests'
   1.235 -	#'RegressionTests::HTTPServerTests'
   1.236  	#'RegressionTests::DebuggerTest'
   1.237  	#'RegressionTests::ContextTest2'
   1.238      )
   1.239 @@ -222,7 +221,6 @@
   1.240  	    #'RegressionTests::GraphicDrawingTest'
   1.241  	    #'RegressionTests::OS_OLE_Tests'
   1.242  	    #'RegressionTests::ExternalInterfaceTests'
   1.243 -	    #'RegressionTests::HTTPServerTests'
   1.244  	    #'RegressionTests::DebuggerTest'
   1.245  	    #'RegressionTests::ContextTest2'
   1.246  	    #'RegressionTests::QDoubleTests'
   1.247 @@ -233,17 +231,17 @@
   1.248  
   1.249  example1
   1.250      Processor activeProcess exceptionHandlerSet
   1.251 -        on:Class updateChangeFileQuerySignal
   1.252 -        do:[:ex | ex proceedWith:false].
   1.253 +	on:Class updateChangeFileQuerySignal
   1.254 +	do:[:ex | ex proceedWith:false].
   1.255  
   1.256      self
   1.257 -        runWithCompiledUnitTestClasses:true
   1.258 -        arguments:#(
   1.259 -            '--runOnlyExpeccoUnitTests' 
   1.260 -            '--forceTestCase' 
   1.261 -            'ExternalStreamTest'
   1.262 -        )
   1.263 -        debug:true
   1.264 +	runWithCompiledUnitTestClasses:true
   1.265 +	arguments:#(
   1.266 +	    '--runOnlyExpeccoUnitTests'
   1.267 +	    '--forceTestCase'
   1.268 +	    'ExternalStreamTest'
   1.269 +	)
   1.270 +	debug:true
   1.271  ! !
   1.272  
   1.273  !RunUnitTests class methodsFor:'logging'!
   1.274 @@ -279,4 +277,3 @@
   1.275  version_CVS
   1.276      ^ '$Header$'
   1.277  ! !
   1.278 -