TestCase.st
author Claus Gittinger <cg@exept.de>
Sun, 21 Aug 2011 15:03:34 +0200
changeset 420 84e640399605
parent 417 b111f3cb1beb
child 421 9b8b2a70d775
permissions -rw-r--r--
changed: #allTestSelectors oops
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
     1
"{ Package: 'stx:goodies/sunit' }"
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
     3
TestAsserter subclass:#TestCase
377
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     4
	instanceVariableNames:'testSelector'
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     5
	classVariableNames:''
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     6
	poolDictionaries:''
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     7
	category:'SUnit-Base'
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
    10
TestCase class instanceVariableNames:'lastOutcomes'
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    11
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    12
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    13
 No other class instance variables are inherited by this class.
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    14
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    15
!
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    16
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    17
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    18
!TestCase class methodsFor:'initialization'!
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    19
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    20
initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    21
    ResumableTestFailure autoload
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    22
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    23
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    24
     self initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    25
    "
326
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    26
!
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    27
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    28
postAutoload
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    29
    self projectDefinitionClass loadExtensions
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    30
! !
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    31
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    32
!TestCase class methodsFor:'instance creation'!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    33
288
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    34
asTestCase
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    35
    ^ self
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    36
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    37
    "Created: / 02-08-2011 / 09:12:13 / cg"
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    38
!
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    39
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    40
debug: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    41
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
    42
        ^(self selector: aSymbol) debug
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    43
!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    44
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    45
run: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    46
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
    47
        ^(self selector: aSymbol) run
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    48
!
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    49
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
selector: aSymbol
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    51
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
    52
        ^self new setTestSelector: aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    53
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    54
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    55
suite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    56
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
    57
        ^self buildSuite
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    60
!TestCase class methodsFor:'accessing'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    61
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    62
allTestSelectors
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    63
    | answer pivotClass lookupRoot |
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    64
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    65
    answer := Set withAll: self testSelectors.
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    66
    self shouldInheritSelectors ifTrue:[
420
84e640399605 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 417
diff changeset
    67
        pivotClass := self.
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    68
        lookupRoot := self lookupHierarchyRoot.
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    69
        [pivotClass == lookupRoot] whileFalse:[
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    70
            pivotClass := pivotClass superclass.
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    71
            answer addAll: pivotClass testSelectors
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    72
        ]
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    73
    ].
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
    74
    ^answer asSortedCollection asOrderedCollection
420
84e640399605 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 417
diff changeset
    75
84e640399605 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 417
diff changeset
    76
    "Modified: / 21-08-2011 / 15:01:47 / cg"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    77
!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    78
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    79
forgetLastTestRunResult
390
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
    80
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
    81
    Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
    82
    self changed:#lastTestRunResult.
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    83
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    84
    "Modified: / 06-08-2006 / 11:40:07 / cg"
390
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
    85
    "Modified: / 20-08-2011 / 15:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    86
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    87
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    88
isTestSelector:aSelector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    89
290
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
    90
    ^aSelector notNil and:[aSelector startsWith:'test']
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    91
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    92
    "Created: / 06-08-2006 / 11:46:17 / cg"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    93
    "Modified: / 05-12-2009 / 18:50:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
290
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
    94
    "Modified: / 02-08-2011 / 17:46:51 / cg"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    95
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    96
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
    97
lastTestRunResultOrNil
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    98
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
    99
    "Returns true if all tests passed, false if at least
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   100
     one failed/error  or nil if never run            
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   101
    "
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   102
    lastOutcomes isNil ifTrue:[^nil].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   103
    lastOutcomes size ~= self testSelectors size ifTrue:[^nil].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   104
    lastOutcomes do:[:outcome|
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   105
        outcome result == #pass ifFalse:[
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   106
            ^false
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   107
        ].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   108
    ].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   109
    ^true
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   110
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   111
    "Modified: / 20-08-2011 / 14:59:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   112
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   113
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   114
lookupHierarchyRoot
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   115
        ^TestCase
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   116
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   117
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   118
rememberOutcome: outcome
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   119
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   120
    lastOutcomes isNil ifTrue:[
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   121
        lastOutcomes := OrderedCollection new.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   122
    ].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   123
    "Not a nice code, but portable..."
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   124
    1 to: lastOutcomes size do:[:i|
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   125
        | each |
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   126
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   127
        each := lastOutcomes at: i.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   128
        (each testCase class == outcome testCase class and:
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   129
            [each testCase selector == outcome testCase selector]) ifTrue:[
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   130
                lastOutcomes at: i put: outcome.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   131
                each result ~= outcome result ifTrue:[
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   132
                    self lastTestRunResultChanged: outcome selector. 
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   133
                ].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   134
                ^self.                    
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   135
            ].
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   136
    ].
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   137
    lastOutcomes add: outcome.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   138
    self lastTestRunResultChanged: outcome selector.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   139
    ^self
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   140
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   141
    "Created: / 20-08-2011 / 12:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   142
!
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   143
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   144
rememberedOutcomeFor: selector
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   145
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   146
    lastOutcomes isNil ifTrue:[^nil].
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   147
    ^lastOutcomes 
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   148
        detect: [:outcome| outcome testCase selector == selector]
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   149
        ifNone:[nil].
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   150
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   151
    "Created: / 20-08-2011 / 14:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   152
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   153
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   154
resources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   155
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   156
        ^#()
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   157
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   158
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   159
shouldFork
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   160
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   161
    ^false
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   162
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   163
    "Created: / 13-06-2011 / 16:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   164
!
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   165
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   166
sunitVersion
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   167
        ^'4.0'
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   168
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   169
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   170
testSelector:selector result: result
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   171
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   172
    lastOutcomes isNil ifTrue:[^false].
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   173
    ^(lastOutcomes 
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   174
        detect:[:each|
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   175
            each testCase class == self
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   176
                and:[each testCase selector == selector
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   177
                    and:[each result == result]]
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   178
        ]
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   179
        ifNone: [nil]) notNil
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   180
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   181
    "Created: / 20-08-2011 / 16:15:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   182
!
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   183
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   184
testSelectorError:selector
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   185
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   186
    ^self testSelector: selector result: #error
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   187
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   188
    "Created: / 15-03-2010 / 19:44:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   189
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   190
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   191
testSelectorFailed:selector
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   192
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   193
    ^self testSelector: selector result: #fail
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   194
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   195
    "Modified: / 20-08-2011 / 16:16:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   196
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   197
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   198
testSelectorPassed:selector
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   199
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   200
   ^self testSelector: selector result: #pass
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   201
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   202
    "Created: / 15-03-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   203
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   204
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   205
!TestCase class methodsFor:'building suites'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   206
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   207
buildSuite
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   208
        | suite |
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   209
        ^self isAbstract
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   210
                ifTrue:
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   211
                        [suite := self suiteClass named: self name asString.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   212
                        self allSubclasses
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   213
                                do: [:each | each isAbstract ifFalse: [suite addTest: each buildSuiteFromSelectors]].
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   214
                        suite]
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   215
                ifFalse: [self buildSuiteFromSelectors]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   216
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   217
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   218
buildSuiteFromMethods: testMethods
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   219
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   220
        ^testMethods
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   221
                inject: (self suiteClass named: self name asString)
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   222
                into: [:suite :selector |
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   223
                        suite
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   224
                                addTest: (self selector: selector);
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   225
                                yourself]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   226
!
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
   227
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   228
buildSuiteFromSelectors
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   229
        ^self buildSuiteFromMethods: self allTestSelectors
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   230
!
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   231
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   232
suiteClass
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   233
        ^TestSuite
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   234
! !
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   235
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   236
!TestCase class methodsFor:'misc ui support'!
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   237
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   238
iconInBrowserSymbol
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   239
    <resource: #programImage>
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   240
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   241
    |lastResult|
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   242
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   243
    self theNonMetaclass isAbstract ifTrue:[^ super iconInBrowserSymbol].
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   244
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   245
    lastResult := self lastTestRunResultOrNil.
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   246
    lastResult == true ifTrue:[
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   247
        ^ #testCasePassedIcon
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   248
    ].
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   249
    lastResult == false ifTrue:[
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   250
        ^ #testCaseFailedIcon
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   251
    ].
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   252
    ^ #testCaseClassIcon
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   253
! !
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   254
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   255
!TestCase class methodsFor:'private'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   256
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   257
addSelector: selector to: collection
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   258
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   259
    "Adds given selector from collection. Answers
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   260
     true iff selector was really added"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   261
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   262
    ^(collection includes: selector)
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   263
        ifTrue:[false]
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   264
        ifFalse:[collection add: selector. true]
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   265
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   266
    "Created: / 15-03-2010 / 18:06:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   267
    "Modified: / 21-04-2010 / 23:19:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   268
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   269
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   270
lastTestRunResultChanged: selector
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   271
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   272
    Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector).
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   273
    self changed:#lastTestRunResult with:selector.
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   274
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   275
    "Created: / 15-03-2010 / 19:15:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   276
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   277
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   278
testSelectors
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   279
        "The API method is allTestSelectors which now includes #shouldInheritSelectors and so handles all cases.  Unlike that method, this does not guarantee to return a sorted ordered collection."
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   280
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   281
        ^self sunitSelectors select: [:each | 'test*' sunitMatch: each]
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   282
! !
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   283
417
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   284
!TestCase class methodsFor:'queries'!
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   285
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   286
coveredClassNames
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   287
    "should be redefined to return a collection of classes which are tested by
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   288
     this suite/case. These classes can be instrumented for coverage analysis,
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   289
     before running the suite"
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   290
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   291
    ^ #()
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   292
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   293
    "Created: / 06-07-2011 / 21:27:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   294
!
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   295
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   296
coveredClasses
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   297
    "return a collection of classes which are tested by this suite/case. 
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   298
     These classes can be instrumented for coverage analysis,
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   299
     before running the suite"
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   300
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   301
    ^ self coveredClassNames collect:[:each | Smalltalk classNamed:each]
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   302
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   303
    "Created: / 04-07-2011 / 18:16:08 / cg"
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   304
! !
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   305
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   306
!TestCase class methodsFor:'quick testing'!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   307
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   308
assert: aBoolean
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   309
    ^ self new assert: aBoolean
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   310
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   311
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   312
     TestCase assert: true
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   313
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   314
!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   315
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   316
should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   317
    ^ self new should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   318
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   319
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   320
     TestCase should:[ self error ] raise: Error
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   321
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   322
! !
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   323
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   324
!TestCase class methodsFor:'testing'!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   325
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   326
isAbstract
326
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
   327
        "Override to true if a TestCase subclass is Abstract and should not have
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
   328
        TestCase instances built from it"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   329
326
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
   330
        ^self sunitName = #TestCase
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   331
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   332
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   333
isTestCaseLike
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   334
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   335
    ^true
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   336
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   337
    "Created: / 06-03-2011 / 00:16:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   338
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   339
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   340
rememberResult:result
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   341
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   342
    result outcomesDo:[:outcome|self rememberOutcome: outcome].
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   343
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   344
    "Created: / 05-08-2006 / 12:33:08 / cg"
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   345
    "Modified: / 20-08-2011 / 14:02:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   346
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   347
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   348
runTests
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   349
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   350
    ^self suite run
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   351
265
125e4f132d46 remember execution time (needed to generate prober reports)
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   352
    "Modified: / 30-07-2011 / 09:26:11 / cg"
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   353
    "Modified: / 20-08-2011 / 16:14:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   354
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   355
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   356
shouldInheritSelectors
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   357
        "I should inherit from an Abstract superclass but not from a concrete one by default, unless I have no testSelectors in which case I must be expecting to inherit them from my superclass.  If a test case with selectors wants to inherit selectors from a concrete superclass, override this to true in that subclass."
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   358
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   359
        ^self ~~ self lookupHierarchyRoot
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   360
                and: [self superclass isAbstract
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   361
                        or: [self testSelectors isEmpty]]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   362
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   363
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   364
!TestCase methodsFor:'accessing'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   365
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   366
resources
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   367
        "We give TestCase this instance-side method so that methods polymorphic with TestSuite can be code-identical.  Having this instance-side method also helps when writing tests of resource behaviour. Except for such tests, it is rare to override this method and should not be done without thought.  If there were a good reason why a single test case needed to share tests requiring different resources, it might be legitimate."
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   368
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   369
        ^self class resources
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   370
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   371
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   372
selector
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   373
        ^testSelector
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   374
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   375
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   376
shouldFork
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   377
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   378
    ^self class shouldFork
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   379
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   380
    "Created: / 13-06-2011 / 16:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
305
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   381
!
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   382
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   383
testCount
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   384
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   385
    ^1
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   386
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   387
    "Created: / 04-08-2011 / 13:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   388
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   389
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   390
!TestCase methodsFor:'accessing & queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   391
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   392
unfinished
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   393
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   394
        "indicates an unfinished test"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   395
! !
97
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   396
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   397
!TestCase methodsFor:'assertions'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   398
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   399
assert:aBlock completesInSeconds:aNumber
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   400
    "fail, if aBlock does not finish its work in aNumber seconds"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   401
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   402
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   403
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   404
    |done process semaphore|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   405
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   406
    done := false.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   407
    semaphore := Semaphore new.
174
3fff3dede568 #assert:completedInSeconds:
Stefan Vogel <sv@exept.de>
parents: 139
diff changeset
   408
    process := [
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   409
        aBlock value.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   410
        done := true.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   411
        semaphore signal
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   412
    ] fork.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   413
    semaphore waitWithTimeout: aNumber.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   414
    process terminate.
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   415
    self assert: done
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   416
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   417
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   418
     self new assert:[Delay waitForSeconds:2] completesInSeconds:1
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   419
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   420
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   421
     self new assert:[Delay waitForSeconds:1] completesInSeconds:2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   422
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   423
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   424
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   425
assert: aBoolean message:messageIfFailing
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   426
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   427
    ^self assert: aBoolean description: messageIfFailing
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   428
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   429
    "Modified: / 05-12-2009 / 18:16:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   430
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   431
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   432
assertFalse:aBoolean
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   433
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   434
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   435
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   436
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   437
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   438
assertFalse:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   439
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   440
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   441
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   442
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   443
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   444
assertTrue:aBoolean
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   445
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   446
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   447
    ^ self assert:aBoolean
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   448
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   449
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   450
assertTrue:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   451
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   452
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   453
    ^ self assert:aBoolean
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   454
! !
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   455
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   456
!TestCase methodsFor:'dependencies'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   457
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   458
addDependentToHierachy: anObject
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   459
        "an empty method. for Composite compability with TestSuite"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   460
!
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   461
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   462
removeDependentFromHierachy: anObject
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   463
        "an empty method. for Composite compability with TestSuite"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   464
! !
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   465
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   466
!TestCase methodsFor:'deprecated'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   467
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   468
should: aBlock
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   469
        self assert: aBlock value
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   470
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   471
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   472
should: aBlock description: aString
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   473
        self assert: aBlock value description: aString
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   474
!
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   475
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   476
shouldnt: aBlock
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   477
        self deny: aBlock value
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   478
!
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   479
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   480
shouldnt: aBlock description: aString
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   481
        self deny: aBlock value description: aString
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   482
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   483
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   484
signalFailure: aString
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   485
        TestResult failure sunitSignalWith: aString.
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   486
! !
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   487
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   488
!TestCase methodsFor:'printing'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   489
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   490
getTestName
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   491
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   492
    ^testSelector.
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   493
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   494
    "Modified: / 05-12-2009 / 17:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   495
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   496
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   497
name
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   498
        ^ self class name.
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   499
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   500
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   501
printOn: aStream
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   502
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   503
        aStream
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   504
                nextPutAll: self class printString;
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   505
                nextPutAll: '>>#';
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   506
                nextPutAll: testSelector
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   507
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   508
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   509
!TestCase methodsFor:'private'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   510
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   511
executeShould: aBlock inScopeOf: anExceptionalEvent
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   512
"/        ^[aBlock value.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   513
"/        false] sunitOn: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   514
"/                do: [:ex | ex sunitExitWith: true]
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   515
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   516
"/        [[aBlock value]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   517
"/                on: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   518
"/                do: [:ex | ^true]]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   519
"/                        on: TestResult exError
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   520
"/                        do: [:ex | ^false].
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   521
        [aBlock value]
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   522
                on: anExceptionalEvent
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   523
                do: [:ex | ^true].
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   524
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   525
        ^false.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   526
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   527
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   528
performTest
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   529
    self perform: testSelector sunitAsSymbol
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   530
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   531
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   532
setTestSelector: aSymbol
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   533
        testSelector := aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   534
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   535
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   536
signalFailure:aString resumable:isResumable
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   537
    "/        TestResult failure sunitSignalWith: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   538
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   539
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   540
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   541
    isResumable ifTrue:[
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   542
        TestResult resumableFailure
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   543
            raiseRequestWith:nil
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   544
            errorString:aString
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   545
            in:thisContext sender sender
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   546
    ] ifFalse:[
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   547
        TestResult failure
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   548
            raiseErrorString:aString
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   549
            in:thisContext sender sender
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   550
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   551
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   552
    "Modified: / 06-08-2006 / 22:55:55 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   553
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   554
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   555
signalUnavailableResources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   556
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   557
    self resources do:[:res |
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   558
        res isAvailable ifFalse:[
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   559
            ^ res signalInitializationError
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   560
        ]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   561
    ].
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   562
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   563
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   564
!TestCase methodsFor:'queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   565
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   566
isTestCase
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   567
    ^ true
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   568
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   569
221
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   570
isTestCaseLike
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   571
    ^ true
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   572
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   573
    "Created: / 29-06-2011 / 20:37:57 / cg"
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   574
!
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   575
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   576
isTestSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   577
    ^ false
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   578
! !
122
61e456491017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   579
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   580
!TestCase methodsFor:'running'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   581
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   582
debug
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   583
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   584
    | testCase outcome |
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   585
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   586
    [
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   587
        (testCase := self class selector: testSelector) runCase.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   588
        outcome := TestCaseOutcome new.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   589
        outcome testCase: testCase.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   590
        outcome result: #pass.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   591
        outcome remember.
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   592
    ] sunitEnsure: [
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   593
        TestResource resetResources: self resources
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   594
    ].
254
7f4b9fc9756b changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents: 240
diff changeset
   595
7f4b9fc9756b changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents: 240
diff changeset
   596
    "Modified: / 07-07-2011 / 11:10:50 / jv"
7f4b9fc9756b changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents: 240
diff changeset
   597
    "Modified: / 07-07-2011 / 11:34:08 / Jan Vrany <jan.vrant@fit.cvut,cz>"
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   598
    "Modified: / 20-08-2011 / 14:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   599
!
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   600
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   601
debugAsFailure
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   602
        | semaphore |
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   603
        semaphore := Semaphore new.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   604
        [semaphore wait. TestResource resetResources: self resources] fork.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   605
        (self class selector: testSelector) runCaseAsFailure: semaphore.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   606
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   607
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   608
debugUsing:aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   609
    self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   610
    [
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   611
        "/ used to be:
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   612
        "/  (self class selector:testSelector) perform:aSymbol
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   613
        "/ which is bad for subclasses which need more arguments.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   614
        "/ why not use:
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   615
        "/  self copy perform:aSymbol
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   616
        "/ or even
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   617
        "/  self perform:aSymbol
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   618
        "/ (self class selector:testSelector) perform:aSymbol
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   619
        self perform:aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   620
    ] ensure:[
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   621
        self resources do:[:each |
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   622
            each reset
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   623
        ]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   624
    ]
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   625
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   626
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   627
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   628
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   629
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   630
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   631
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   632
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   633
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   634
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   635
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   636
failureLog
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   637
        ^SUnitNameResolver class >> #defaultLogDevice
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   638
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   639
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   640
isLogging
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   641
        "By default, we're not logging failures. If you override this in
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   642
        a subclass, make sure that you override #failureLog"
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   643
        ^false
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   644
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   645
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   646
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   647
logFailure: aString
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   648
        self isLogging ifTrue: [
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   649
                self failureLog
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   650
                        cr;
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   651
                        nextPutAll: aString;
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   652
                        flush]
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   653
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   654
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   655
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   656
openDebuggerOnFailingTestMethod
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   657
        "SUnit has halted one step in front of the failing test method. Step over the 'self halt' and
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   658
         send into 'self perform: testSelector' to see the failure from the beginning"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   659
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   660
        self
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   661
                "/halt;
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   662
                performTest
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   663
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   664
    "Modified: / 05-12-2009 / 18:40:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   665
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   666
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   667
run
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   668
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   669
    ^self run: TestResult new
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   670
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   671
    "Modified: / 29-07-2011 / 12:07:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   672
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   673
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   674
run: aResult
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   675
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   676
    ^self run: aResult beforeEachDo: [:test :result|] afterEachDo: [:test :result|]
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   677
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   678
    "Modified: / 29-07-2011 / 12:07:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   679
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   680
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   681
run: aResult afterEachDo:block2
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   682
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   683
    ^self run: aResult beforeEachDo: [:test :result|] afterEachDo:block2
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   684
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   685
    "Modified: / 29-07-2011 / 12:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   686
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   687
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   688
run: aResult beforeEachDo:block1 afterEachDo:block2
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   689
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   690
    ^self run: aResult beforeEachDo:block1 afterEachDo:block2 resetResources: true
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   691
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   692
    "Modified: / 29-07-2011 / 12:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   693
!
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   694
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   695
run: result beforeEachDo: before afterEachDo: after resetResources: reset
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   696
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   697
    "Workhorse for running a testcase. If reset is true, then
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   698
     the resources are reset, otherwise not"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   699
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   700
    "1. Execute before block"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   701
    "This code is ugly in Smalltalk/X but it is so because
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   702
     it is more portable - numArgs in ANSI (?)"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   703
    before numArgs == 2 ifTrue:[
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   704
        before value: self value: result                
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   705
    ] ifFalse:[
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   706
        before numArgs == 1 ifTrue:[
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   707
            before value: self
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   708
        ] ifFalse:[
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   709
            before value.
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   710
        ]
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   711
    ].
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   712
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   713
    "2. Run the testcase"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   714
    reset ifTrue:[
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   715
        [
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   716
            result runCase: self
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   717
        ] sunitEnsure: [
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   718
            TestResource resetResources: self resources
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   719
        ].
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   720
    ] ifFalse:[
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   721
        result runCase: self
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   722
    ].
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   723
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   724
    "3. Execute after block"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   725
    "This code is ugly in Smalltalk/X but it is so because
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   726
     it is more portable - numArgs in ANSI (?)"
282
deb55165e73b changed: #run:beforeEachDo:afterEachDo:resetResources:
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   727
    after numArgs == 2 ifTrue:[
deb55165e73b changed: #run:beforeEachDo:afterEachDo:resetResources:
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   728
        after value: self value: result                
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   729
    ] ifFalse:[
282
deb55165e73b changed: #run:beforeEachDo:afterEachDo:resetResources:
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   730
        after numArgs == 1 ifTrue:[
deb55165e73b changed: #run:beforeEachDo:afterEachDo:resetResources:
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   731
            after value: self
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   732
        ] ifFalse:[
282
deb55165e73b changed: #run:beforeEachDo:afterEachDo:resetResources:
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   733
            after value.
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   734
        ]
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   735
    ].
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   736
    ^result
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   737
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   738
    "Created: / 29-07-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
282
deb55165e73b changed: #run:beforeEachDo:afterEachDo:resetResources:
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   739
    "Modified: / 01-08-2011 / 10:22:09 / cg"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   740
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   741
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   742
run: aResult beforeEachTestCaseDo:block1 afterEachTestCaseDo:block2
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   743
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   744
    <resource: #obsolete>
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   745
    self obsoleteMethodWarning: 'Use #run:beforeEachDo:afterEachDo: instead'.
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   746
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   747
    ^self run: aResult beforeEachDo:block1 afterEachDo:block2
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   748
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
   749
    "Modified: / 29-07-2011 / 12:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   750
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   751
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   752
runCase
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   753
    self resources do: [:each | each availableFor: self].
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   754
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   755
    [
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   756
        self setUp.
377
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   757
        self performTest.
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   758
    ] sunitEnsure: [
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   759
        self tearDown
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   760
    ]
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   761
377
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
   762
    "Modified (comment): / 18-08-2011 / 20:35:20 / cg"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   763
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   764
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   765
runCaseAsFailure
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   766
        self setUp.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   767
        [[self openDebuggerOnFailingTestMethod] ensure: [self tearDown]] fork
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   768
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   769
    "Modified: / 21.6.2000 / 10:04:33 / Sames"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   770
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   771
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   772
runCaseAsFailure: aSemaphore
331
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   773
        [self resources do: [:each | each availableFor: self].
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   774
        [self setUp.
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   775
        self openDebuggerOnFailingTestMethod]
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   776
                sunitEnsure: [self tearDown]]
ea59d5e02844 moved: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   777
                        sunitEnsure: [aSemaphore signal].
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   778
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   779
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   780
setUp
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   781
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   782
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   783
tearDown
50
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
   784
! !
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
   785
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   786
!TestCase class methodsFor:'documentation'!
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   787
290
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
   788
version
420
84e640399605 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 417
diff changeset
   789
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.80 2011-08-21 13:03:34 cg Exp $'
290
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
   790
!
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
   791
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   792
version_CVS
420
84e640399605 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 417
diff changeset
   793
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.80 2011-08-21 13:03:34 cg Exp $'
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   794
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   795
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   796
version_SVN
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   797
    ^ '§Id: TestCase.st 218 2011-06-13 15:45:06Z vranyj1 §'
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   798
! !
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   799
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   800
TestCase initialize!