Tools__AbstractTestRunner.st
author Claus Gittinger <cg@exept.de>
Thu, 30 Jun 2011 21:53:50 +0200
changeset 9957 35dc65b35806
parent 9952 c0f118b6b0aa
child 10091 e715a30bfc47
permissions -rw-r--r--
categ

"
 COPYRIGHT (c) 2006 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

ApplicationModel subclass:#AbstractTestRunner
	instanceVariableNames:''
	classVariableNames:'NotRunColor PassedColor FailureColor ErrorColor'
	poolDictionaries:''
	category:'SUnit-UI'
!

!AbstractTestRunner class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!AbstractTestRunner class methodsFor:'initialization'!

initialize
    "Invoked at system start or when the class is dynamically loaded."

    NotRunColor     := Color redByte:145 greenByte:145 blueByte:145.
    PassedColor     := Color redByte:92 greenByte:166 blueByte:92.
    FailureColor    := Color redByte:194 greenByte:110 blueByte:110.
    ErrorColor      := FailureColor

    "Modified: / 15-03-2010 / 21:59:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!AbstractTestRunner class methodsFor:'accessing'!

errorColor
    ^ ErrorColor

    "Created: / 07-02-2010 / 14:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 15-03-2010 / 21:53:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

failedColor
    ^ FailureColor

    "Modified: / 15-03-2010 / 21:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

notRunColor
    ^ NotRunColor

    "Created: / 15-03-2010 / 09:55:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 15-03-2010 / 21:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

passedColor
    ^ PassedColor

    "Modified: / 15-03-2010 / 21:54:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!AbstractTestRunner methodsFor:'private'!

buildSuiteFromClass:testCaseCls

    ^testCaseCls asTestCase buildSuite

    "Modified: / 04-03-2011 / 08:22:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

isTestCaseLike:cls 

    ^cls isTestCaseLike

    "Modified: / 28-02-2011 / 21:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!AbstractTestRunner methodsFor:'utilities'!

suiteNameFromClasses: classes

    classes size = 1 ifTrue:
        [^classes anyOne nameWithoutPrefix].
    classes size = 2 ifTrue:
        [^String streamContents:
            [:s|classes 
                do:[:cls|s nextPutAll: cls nameWithoutPrefix]
                separatedBy:[s nextPutAll:' & ']]].

    ^classes size printString , ' test cases'.

    "Created: / 15-03-2010 / 13:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

suiteNameFromMethods: methods

    methods size = 1 ifTrue:[^methods anyOne selector].
    ^methods size printString , ' tests from ' ,
        (self suiteNameFromClasses: (methods collect:[:m|m mclass]) asSet)

    "Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

suiteNameFromProtocols: protocols

    protocols size = 1 ifTrue:[^'tests categorized "', protocols anyOne , '"'].
    ^'tests in ', protocols size printString , ' categories'

    "Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 15-03-2010 / 19:53:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!AbstractTestRunner class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libtool/Tools__AbstractTestRunner.st,v 1.2 2011-06-30 19:53:50 cg Exp $'
!

version_SVN
    ^ '§Id: Tools__AbstractTestRunner.st 7681 2011-03-04 11:30:02Z vranyj1 §'
! !

AbstractTestRunner initialize!