#BUGFIX by sr draft
authorsr
Wed, 16 May 2018 13:59:55 +0200
changeset 516 f0cf7d35ee5f
parent 515 06436c1b24f6
child 517 2c7183682018
#BUGFIX by sr class: RunUnitTests class comment/format in: #runWithCompiledUnitTestClasses:arguments:debug:
quickSelfTest/RunUnitTests.st
--- a/quickSelfTest/RunUnitTests.st	Fri May 11 16:42:39 2018 +0200
+++ b/quickSelfTest/RunUnitTests.st	Wed May 16 13:59:55 2018 +0200
@@ -50,7 +50,7 @@
     arguments:arguments
     debug:debug
 
-    |doRunSpecificUnitTests unitTestSuiteName excludedUnitTestClassNames b
+    |doRunSpecificUnitTests unitTestSuiteName excludedUnitTestClassNames corruptedUnitTestClassNames
      unitTestSuite
      eachClass
      result index
@@ -63,127 +63,129 @@
 
     index := arguments indexOf:'--settingsFile'.
     index > 0 ifTrue:[
-	settingsFilePathName := arguments at:index + 1.
-	self logInfo:'load settings file: ', settingsFilePathName printString.
-	settingsFilePathName asFilename fileIn.
-	self logInfo:'ParserFlags makeCommand: ', ParserFlags makeCommand printString.
+        settingsFilePathName := arguments at:index + 1.
+        self logInfo:'load settings file: ', settingsFilePathName printString.
+        settingsFilePathName asFilename fileIn.
+        self logInfo:'ParserFlags makeCommand: ', ParserFlags makeCommand printString.
     ].
 
     (arguments includes:'--runOnlyExpeccoUnitTests') ifTrue:[
-	self logInfo:'configured to run expecco unit tests only'.
-	doRunSpecificUnitTests := true.
-	unitTestSuiteName := 'expecco Unit Tests'.
-	excludedUnitTestClassNames := self excludedUnitTestClassNamesForExpecco.
+        self logInfo:'configured to run expecco unit tests only'.
+        doRunSpecificUnitTests := true.
+        unitTestSuiteName := 'expecco Unit Tests'.
+        excludedUnitTestClassNames := self excludedUnitTestClassNamesForExpecco.
     ].
 
     index := arguments indexOf:'--resultFile'.
     index > 0 ifTrue:[
-	resultFilePathName := arguments at:index + 1.
-	self logInfo:'set custom result file: ', resultFilePathName printString.
+        resultFilePathName := arguments at:index + 1.
+        self logInfo:'set custom result file: ', resultFilePathName printString.
     ].
 
     index := arguments indexOf:'--forceTestCase'.
     index > 0 ifTrue:[
-	forceTestCase := arguments at:index + 1.
-	self logInfo:'set force test case: ', forceTestCase printString.
+        forceTestCase := arguments at:index + 1.
+        self logInfo:'set force test case: ', forceTestCase printString.
     ].
 
     doRunSpecificUnitTests ifFalse:[
-	self logInfo:'configured to run all available unit tests'.
+        self logInfo:'configured to run all available unit tests'.
     ].
 
     self logInfo:'collecting unit test classes to run'.
     unitTestSuite := TestSuite named:unitTestSuiteName.
 
     (Smalltalk at: #'stx_goodies_regression') classNames do:[:eachClassName |
-	(excludedUnitTestClassNames includes:eachClassName) ifTrue:[
-	    self
-		logInfo:('excluded unit test class "%1".'
-		    bindWith:eachClassName).
-	] ifFalse:[
-	    (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[
-		self
-		    logWarning:('RunUnitTest: unit test class is marked as corrupted, please fix #%1'
-			bindWith:eachClassName).
-	    ] ifFalse:[
-		(eachClassName notNil
-		and:[
-		    "/ skip non test case classes
-		    (#(
-			'stx_goodies_regression'
-		    ) includes:eachClassName) not
-		and:[
-		    forceTestCase isNil
-		    or:[forceTestCase = eachClassName
-		    or:[forceTestCase = ((eachClassName subStrings:'::') lastIfEmpty:nil)]]
-		]]) ifTrue:[
-		    eachClass := Smalltalk at:eachClassName.
+        (excludedUnitTestClassNames includes:eachClassName) ifTrue:[
+            self
+                logInfo:('excluded unit test class "%1".'
+                    bindWith:eachClassName).
+        ] ifFalse:[
+            (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[
+                self
+                    logWarning:('RunUnitTest: unit test class is marked as corrupted, please fix #%1'
+                        bindWith:eachClassName).
+            ] ifFalse:[
+                (eachClassName notNil
+                and:[
+                    "/ skip non test case classes
+                    (#(
+                        'stx_goodies_regression'
+                    ) includes:eachClassName) not
+                and:[
+                    forceTestCase isNil
+                    or:[forceTestCase = eachClassName
+                    or:[forceTestCase = ((eachClassName subStrings:'::') lastIfEmpty:nil)]]
+                ]]) ifTrue:[
+                    eachClass := Smalltalk at:eachClassName.
 
-		    useCompiledUnitTestClasses ifFalse:[
-			"here we want test the jitter code
-			 therfor we file in, exit if the class is already present somwhow"
-			eachClass notNil ifTrue:[
-			    self
-				logWarning:('Unit test class "%1" was already present before file in.'
-				    bindWith:eachClassName).
+                    useCompiledUnitTestClasses ifFalse:[
+                        "here we want test the jitter code
+                         therfor we file in, exit if the class is already present somwhow"
+                        eachClass notNil ifTrue:[
+                            self
+                                logWarning:('Unit test class "%1" was already present before file in.'
+                                    bindWith:eachClassName).
 
-			    Smalltalk exit:1.
-			].
+                            Smalltalk exit:1.
+                        ].
 
-			eachClass := Smalltalk
-			    fileInClass:eachClassName
-			    package:'stx:goodies/regression'.
-		    ].
+                        eachClass := Smalltalk
+                            fileInClass:eachClassName
+                            package:'stx:goodies/regression'.
+                    ].
 
-		    eachClass notNil ifTrue:[
-			(eachClass isTestCaseLike
-			and:[eachClass isAbstract not]) ifTrue:[
-			    self
-				logInfo:('added unit test class "%1".'
-				    bindWith:eachClassName).
+                    eachClass notNil ifTrue:[
+                        (eachClass isTestCaseLike
+                        and:[eachClass isAbstract not]) ifTrue:[
+                            self
+                                logInfo:('added unit test class "%1".'
+                                    bindWith:eachClassName).
 
-			    unitTestSuite addTest:eachClass suite.
-			] ifFalse:[
-			    self
-				logInfo:('not a unit test class "%1" (class is abstract or something else).'
-				    bindWith:eachClassName).
-			].
-		    ] ifFalse:[
-			self
-			    logWarning:('unit test class "%1" is not loaded.'
-				bindWith:eachClassName).
-		    ].
-		] ifFalse:[
-		    self
-			logInfo:('skipped unit test class "%1".'
-			    bindWith:eachClassName).
-		].
-	    ].
-	].
+                            unitTestSuite addTest:eachClass suite.
+                        ] ifFalse:[
+                            self
+                                logInfo:('not a unit test class "%1" (class is abstract or something else).'
+                                    bindWith:eachClassName).
+                        ].
+                    ] ifFalse:[
+                        self
+                            logWarning:('unit test class "%1" is not loaded.'
+                                bindWith:eachClassName).
+                    ].
+                ] ifFalse:[
+                    self
+                        logInfo:('skipped unit test class "%1".'
+                            bindWith:eachClassName).
+                ].
+            ].
+        ].
     ].
 
     self
-	logInfo:('%1 unit test classes collected'
-	    bindWith:unitTestSuite tests size).
+        logInfo:('%1 unit test classes collected'
+            bindWith:unitTestSuite tests size).
 
     self logInfo:'starting unit tests'.
     result := unitTestSuite
-	run:TestResultStX new
-	beforeEachDo:[:test | self logInfo:'performing unit test ', test printString]
-	afterEachDo:[:test| ]
-	debug:debug.
+        run:TestResultStX new
+        beforeEachDo:[:test | self logInfo:'performing unit test ', test printString]
+        afterEachDo:[:test| ]
+        debug:debug.
 
     self logInfo:'generating report'.
     TestResultReporter
-	report:result
-	format:#xml_jUnit
-	as:resultFilePathName ? 'testresult.xml'.
+        report:result
+        format:#xml_jUnit
+        as:resultFilePathName ? 'testresult.xml'.
 
     self logInfo:'summary:'.
     self logInfo:('%1 tests' bindWith:result runCount).
     self logInfo:('%1 passed' bindWith:result passedCount).
     self logInfo:('%1 failed' bindWith:result failureCount).
     self logInfo:('%1 errors' bindWith:result errorCount).
+
+    "Modified (format): / 16-05-2018 / 13:59:47 / sr"
 ! !
 
 !RunUnitTests class methodsFor:'constants'!
@@ -277,3 +279,4 @@
 version_CVS
     ^ '$Header$'
 ! !
+