TestSuitesScripter.st
changeset 37 6da5b7e8e3ab
parent 32 77f76ea3a7ef
child 54 0885c334af10
equal deleted inserted replaced
36:6e7ee8f590b2 37:6da5b7e8e3ab
    16     "Modified: / 21.6.2000 / 10:18:08 / Sames"
    16     "Modified: / 21.6.2000 / 10:18:08 / Sames"
    17 ! !
    17 ! !
    18 
    18 
    19 !TestSuitesScripter class methodsFor:'Init / Release'!
    19 !TestSuitesScripter class methodsFor:'Init / Release'!
    20 
    20 
    21 run: aString
    21 run: testClassNameString
    22 	^self new run: aString
    22         ^self new run: testClassNameString
    23 !
    23 !
    24 
    24 
    25 script: aString
    25 script: aString
    26 	^self new setScript: aString
    26 	^self new setScript: aString
    27 ! !
    27 ! !
    67 !
    67 !
    68 
    68 
    69 hierachyOfTestSuitesFrom: aTestCase 
    69 hierachyOfTestSuitesFrom: aTestCase 
    70         | subSuite |
    70         | subSuite |
    71         subSuite := TestSuite new.
    71         subSuite := TestSuite new.
       
    72         subSuite name:aTestCase name.
    72         subSuite addTest: aTestCase suite.
    73         subSuite addTest: aTestCase suite.
    73         aTestCase allSubclasses do: [:each | subSuite addTest: each name asSymbol sunitAsClass suite].
    74         aTestCase allSubclasses do: [:each | subSuite addTest: each name asSymbol sunitAsClass suite].
    74         ^subSuite
    75         ^subSuite
    75 
    76 
    76     "Modified: / 21.6.2000 / 10:16:29 / Sames"
    77     "Modified: / 21.6.2000 / 10:16:29 / Sames"
    93     "Modified: / 21.6.2000 / 10:16:47 / Sames"
    94     "Modified: / 21.6.2000 / 10:16:47 / Sames"
    94 ! !
    95 ! !
    95 
    96 
    96 !TestSuitesScripter methodsFor:'Scripting'!
    97 !TestSuitesScripter methodsFor:'Scripting'!
    97 
    98 
    98 run: aString
    99 run: testClassNameString
    99         | suite subSuite token |
   100         | suite subSuite token |
   100         suite := TestSuite new.
   101         suite := TestSuite new.
   101         stream := ReadStream on: aString asArrayOfSubstrings. 
   102         suite name:testClassNameString.
       
   103 
       
   104         stream := ReadStream on: testClassNameString asArrayOfSubstrings. 
   102         [stream atEnd] whileFalse: 
   105         [stream atEnd] whileFalse: 
   103                 [token := self getNextToken.
   106                 [token := self getNextToken.
   104                 token notNil ifTrue: [
   107                 token notNil ifTrue: [
   105                         subSuite := self executeSingleSuiteScript: token.
   108                         subSuite := self executeSingleSuiteScript: token.
   106                         subSuite notNil ifTrue:[suite addTest: subSuite]]].
   109                         subSuite notNil ifTrue:[suite addTest: subSuite]]].
   114 ! !
   117 ! !
   115 
   118 
   116 !TestSuitesScripter class methodsFor:'documentation'!
   119 !TestSuitesScripter class methodsFor:'documentation'!
   117 
   120 
   118 version
   121 version
   119     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestSuitesScripter.st,v 1.4 2001-09-04 13:06:59 cg Exp $'
   122     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestSuitesScripter.st,v 1.5 2001-11-21 15:04:36 cg Exp $'
   120 ! !
   123 ! !