# HG changeset patch # User sr # Date 1505223452 -7200 # Node ID 8dcc6a1f364b7d5c2c40b85658e1b6eabc7cc6ca # Parent aaa1ed543bd03ff727132b4fcb17b97192bfdfed *** empty log message *** diff -r aaa1ed543bd0 -r 8dcc6a1f364b quickSelfTest/RunUnitTests.st --- a/quickSelfTest/RunUnitTests.st Tue Sep 12 13:33:30 2017 +0200 +++ b/quickSelfTest/RunUnitTests.st Tue Sep 12 15:37:32 2017 +0200 @@ -18,7 +18,7 @@ documentation to be added. [author:] - sr + sr [instance variables:] @@ -33,75 +33,75 @@ run |doRunSpecificUnitTests unitTestSuiteName excludedUnitTestClassNames corruptedUnitTestClassNames - cmdArgs - unitTestSuite + cmdArgs + unitTestSuite eachClassName eachClass result| doRunSpecificUnitTests := false. - unitTestSuiteName := 'All Unit Tests'. + unitTestSuiteName := 'All Unit Tests'. excludedUnitTestClassNames := self excludedUnitTestClassNamesForAll. corruptedUnitTestClassNames := self corruptedUnitTestClassNames. cmdArgs := Smalltalk commandLineArguments. (cmdArgs 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. ]. 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') classNamesAndAttributes do:[:eachClassNameAndAttributes | - eachClassNameAndAttributes isSymbol ifTrue:[ - eachClassName := eachClassNameAndAttributes. - ] ifFalse:[ - eachClassName := eachClassNameAndAttributes - firstIfEmpty:nil. - ]. + eachClassNameAndAttributes isSymbol ifTrue:[ + eachClassName := eachClassNameAndAttributes. + ] ifFalse:[ + eachClassName := eachClassNameAndAttributes + firstIfEmpty:nil. + ]. - (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[ - self - logWarning:('corrupted unit test class detected, please fix #%1' - bindWith:eachClassName). - ] ifFalse:[ - (excludedUnitTestClassNames includes:eachClassName) ifFalse:[ - eachClassName notNil ifTrue:[ - eachClass := Smalltalk - fileInClass:eachClassName - package:'stx:goodies/regression'. + (corruptedUnitTestClassNames includes:eachClassName) ifTrue:[ + self + logWarning:('corrupted unit test class detected, please fix #%1' + bindWith:eachClassName). + ] ifFalse:[ + (excludedUnitTestClassNames includes:eachClassName) ifFalse:[ + eachClassName notNil ifTrue:[ + eachClass := Smalltalk + fileInClass:eachClassName + package:'stx:goodies/regression'. - eachClass notNil ifTrue:[ - eachClass isTestCaseLike ifTrue:[ - unitTestSuite addTest:eachClass suite. - ]. - ]. - ]. - ]. - ]. + eachClass notNil ifTrue:[ + eachClass isTestCaseLike ifTrue:[ + unitTestSuite addTest:eachClass suite. + ]. + ]. + ]. + ]. + ]. ]. - self - logInfo:('%1 unit test classes collected' - bindWith:unitTestSuite tests size). + self + 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:(cmdArgs includes:'--debug'). + run:TestResultStX new + beforeEachDo:[:test | self logInfo:'performing unit test ', test printString] + afterEachDo:[:test| ] + debug:(cmdArgs includes:'--debug'). self logInfo:'generating report'. TestResultReporter - report:result - format:#xml_jUnit - as:'testresult.xml'. + report:result + format:#xml_jUnit + as:'testresult.xml'. self logInfo:'summary:'. self logInfo:('%1 tests' bindWith:result runCount). @@ -114,14 +114,14 @@ corruptedUnitTestClassNames ^ #( - #'RegressionTests::ExternalInterfaceTests' - #'RegressionTests::Win32OLETests' - #'RegressionTests::HTTPServerTests' - #'RegressionTests::SocketTests' - #'RegressionTests::DelayTest' - #'RegressionTests::ContextTest2' - #'RegressionTests::DebuggerTest' - #'RegressionTests::OperatingSystem' + #'RegressionTests::ExternalInterfaceTests' + #'RegressionTests::Win32OLETests' + #'RegressionTests::HTTPServerTests' + #'RegressionTests::SocketTests' + #'RegressionTests::DelayTest' + #'RegressionTests::ContextTest2' + #'RegressionTests::DebuggerTest' + #'RegressionTests::OperatingSystem' ) ! @@ -129,11 +129,12 @@ ^ #() ! -excludedUnitTestClassNamesForExpecco +excludedUnitTestClassNamesForExpecco ^ self excludedUnitTestClassNamesForAll - , #( - #'RegressionTests::BreakpointTests' - ) + , #( + #'RegressionTests::BreakpointTests' + #'RegressionTests::SunitXMLOutputTest' + ) ! ! !RunUnitTests class methodsFor:'logging'! @@ -141,22 +142,21 @@ log:aString type:aType - Stdout - showCR:('%1 [%2] : %3' - bindWith:Timestamp now printString - with:(aType printString asLowercase paddedTo:'warning' size) - with:aString). + Stdout + showCR:('%1 [%2] : %3' + bindWith:Timestamp now printString + with:(aType printString asLowercase paddedTo:'warning' size) + with:aString). ! logInfo:aString self - log:aString - type:'INFO' + log:aString + type:'INFO' ! logWarning:aString self - log:aString - type:'WARNING' + log:aString + type:'WARNING' ! ! -