TestCase.st
author Claus Gittinger <cg@exept.de>
Sun, 07 Jul 2019 14:54:40 +0200
changeset 754 a40cfdc417ad
parent 750 1719905cad36
child 755 b62e3bf07b81
permissions -rw-r--r--
#REFACTORING by cg class: TestSuite added: #allCoveredClasses category of: #areAllResourcesAvailable #isTestCase #isTestSuite #signalUnavailableResources
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
     1
"{ Encoding: utf8 }"
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
     2
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
     3
"{ Package: 'stx:goodies/sunit' }"
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
599
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
     5
"{ NameSpace: Smalltalk }"
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
     6
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
     7
TestAsserter subclass:#TestCase
377
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     8
	instanceVariableNames:'testSelector'
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
     9
	classVariableNames:''
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    10
	poolDictionaries:''
71ada743cae2 removed leftover rubbish
Claus Gittinger <cg@exept.de>
parents: 331
diff changeset
    11
	category:'SUnit-Base'
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
    14
TestCase class instanceVariableNames:'lastOutcomes'
81
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
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    17
 No other class instance variables are inherited by this class.
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    18
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    19
!
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    20
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
    21
Object subclass:#Should
719
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
    22
	instanceVariableNames:'assertSelector shouldNot value testCase'
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
    23
	classVariableNames:''
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
    24
	poolDictionaries:''
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
    25
	privateIn:TestCase
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
    26
!
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
    27
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    28
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    29
!TestCase class methodsFor:'initialization'!
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    30
435
vrany
parents: 433
diff changeset
    31
flushAll
vrany
parents: 433
diff changeset
    32
vrany
parents: 433
diff changeset
    33
    "Flush all remembered outcomes in all testcases"
vrany
parents: 433
diff changeset
    34
vrany
parents: 433
diff changeset
    35
    self withAllSubclassesDo:[:cls|
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    36
	cls flushRememberedOutcomes
435
vrany
parents: 433
diff changeset
    37
    ]
vrany
parents: 433
diff changeset
    38
vrany
parents: 433
diff changeset
    39
    "Created: / 17-11-2011 / 19:18:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 433
diff changeset
    40
!
vrany
parents: 433
diff changeset
    41
vrany
parents: 433
diff changeset
    42
flushRememberedOutcomes
vrany
parents: 433
diff changeset
    43
vrany
parents: 433
diff changeset
    44
    "Flushes all remembered outcomes for the receiver"
vrany
parents: 433
diff changeset
    45
vrany
parents: 433
diff changeset
    46
    | outcomes |
vrany
parents: 433
diff changeset
    47
vrany
parents: 433
diff changeset
    48
    lastOutcomes isNil ifTrue:[^self].
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    49
    outcomes := lastOutcomes.
435
vrany
parents: 433
diff changeset
    50
    lastOutcomes := nil.
vrany
parents: 433
diff changeset
    51
    outcomes do:[:outcome|
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    52
	self lastTestRunResultChanged: outcome selector.
435
vrany
parents: 433
diff changeset
    53
    ]
vrany
parents: 433
diff changeset
    54
vrany
parents: 433
diff changeset
    55
    "Created: / 17-11-2011 / 19:17:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 433
diff changeset
    56
!
vrany
parents: 433
diff changeset
    57
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    58
initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    59
    ResumableTestFailure autoload
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    60
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    61
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    62
     self initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    63
    "
326
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    64
!
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    65
4732cd296e5f added: #postAutoload
Stefan Vogel <sv@exept.de>
parents: 305
diff changeset
    66
postAutoload
433
592799735a04 changed: #postAutoload
sr
parents: 430
diff changeset
    67
    |pd|
592799735a04 changed: #postAutoload
sr
parents: 430
diff changeset
    68
592799735a04 changed: #postAutoload
sr
parents: 430
diff changeset
    69
    (pd := self projectDefinitionClass) notNil ifTrue:[
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    70
	pd loadExtensions
433
592799735a04 changed: #postAutoload
sr
parents: 430
diff changeset
    71
    ]
592799735a04 changed: #postAutoload
sr
parents: 430
diff changeset
    72
592799735a04 changed: #postAutoload
sr
parents: 430
diff changeset
    73
    "Modified: / 02-11-2011 / 15:44:58 / sr"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    74
! !
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    75
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    76
!TestCase class methodsFor:'instance creation'!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    77
288
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    78
asTestCase
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    79
    ^ self
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    80
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    81
    "Created: / 02-08-2011 / 09:12:13 / cg"
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    82
!
3a993cee08a0 added: #asTestCase
Claus Gittinger <cg@exept.de>
parents: 282
diff changeset
    83
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    84
debug: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    85
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    86
	^(self selector: aSymbol) debug
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    87
!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    88
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    89
run: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    90
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    91
	^(self selector: aSymbol) run
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    92
!
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    93
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
selector: aSymbol
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    95
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    96
	^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
    97
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    98
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    99
suite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   100
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   101
	^self buildSuite
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   104
!TestCase class methodsFor:'accessing'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   105
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   106
allTestSelectors
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   107
    | answer pivotClass lookupRoot |
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   108
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   109
    answer := Set withAll: self testSelectors.
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   110
    self shouldInheritSelectors ifTrue:[
669
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   111
        pivotClass := self superclass.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   112
        lookupRoot := self lookupHierarchyRoot.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   113
        [pivotClass == lookupRoot] whileFalse:[
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   114
            answer addAll: pivotClass testSelectors.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   115
            pivotClass := pivotClass superclass.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   116
        ]
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
   117
    ].
669
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   118
    answer := answer asOrderedCollection.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   119
    answer sort.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   120
    ^ answer 
420
84e640399605 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 417
diff changeset
   121
421
9b8b2a70d775 changed: #allTestSelectors
Claus Gittinger <cg@exept.de>
parents: 420
diff changeset
   122
    "Modified: / 21-08-2011 / 15:06:11 / cg"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   123
!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   124
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   125
forgetLastTestRunResult
390
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
   126
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
   127
    Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
   128
    self changed:#lastTestRunResult.
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   129
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   130
    "Modified: / 06-08-2006 / 11:40:07 / cg"
390
c2c3895aabd6 changed: #forgetLastTestRunResult
vrany
parents: 382
diff changeset
   131
    "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
   132
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   133
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   134
isTestSelector:aSelector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   135
705
8158508603f3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   136
    ^aSelector notNil 
8158508603f3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   137
    and:[(aSelector startsWith:'test')
8158508603f3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   138
    "/ temporary hack - the callers of testCount should use countTests instead
8158508603f3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   139
    and:[aSelector ~= 'testCount']]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   140
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   141
    "Created: / 06-08-2006 / 11:46:17 / cg"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   142
    "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
   143
    "Modified: / 02-08-2011 / 17:46:51 / cg"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   144
!
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
lastTestRunResultOrNil
578
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   147
    "Returns a state (TestResult stateXXX), depending
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   148
     on the state of the tests:
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   149
	statePass if all tests passed,
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   150
	stateError if any error,
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   151
	stateFail if any fail,
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   152
     or nil if never run
578
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   153
    "
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   154
578
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   155
    |anyFail|
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   156
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   157
    lastOutcomes isNil ifTrue:[^nil].
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   158
    lastOutcomes size ~= self testSelectors size ifTrue:[^nil].
578
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   159
    anyFail := false.
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   160
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   161
    lastOutcomes do:[:outcome|
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   162
	outcome result == (TestResult stateError) ifTrue:[
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   163
	    ^ TestResult stateError
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   164
	].
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   165
	outcome result == (TestResult stateFail) ifTrue:[
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   166
	    anyFail := true
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   167
	].
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   168
    ].
578
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   169
    anyFail ifTrue:[ ^ TestResult stateFail ].
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   170
    ^ TestResult statePass
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   171
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   172
    "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
   173
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   174
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   175
lookupHierarchyRoot
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   176
	^TestCase
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   177
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   178
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   179
rememberOutcome: thisOutcome
626
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   180
    |thisTestCase someOtherOutcome someOtherTestCase    
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   181
     thisTestCaseSelector thisTestCaseClassName|
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   182
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   183
    thisTestCase := thisOutcome testCase.
626
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   184
    thisTestCaseSelector := thisTestCase selector.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   185
    thisTestCaseClassName := thisTestCase class name.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   186
    
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   187
    lastOutcomes isNil ifTrue:[
626
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   188
        lastOutcomes := OrderedCollection new.
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   189
    ].
445
874deaef2599 changed:
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   190
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   191
    "Not a nice code, but portable (what: doWithIndex: is not portable?)"
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   192
    1 to: lastOutcomes size do:[:i|
626
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   193
        someOtherOutcome := lastOutcomes at: i.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   194
        someOtherTestCase := someOtherOutcome testCase.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   195
        "/ compare by classes name - in case it got redefined
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   196
        (someOtherTestCase selector == thisTestCaseSelector
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   197
        and: [someOtherTestCase class name = thisTestCaseClassName]) ifTrue:[
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   198
            "remember; for the timestamp and other info"
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   199
            lastOutcomes at: i put: thisOutcome.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   200
            someOtherOutcome result ~= thisOutcome result ifTrue:[
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   201
                "but only send out change notification to browser if state has changed"
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   202
                self lastTestRunResultChanged: thisOutcome selector.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   203
            ].
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   204
            ^self.
4653000fda69 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 624
diff changeset
   205
        ].
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   206
    ].
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   207
    lastOutcomes add: thisOutcome.
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   208
    self lastTestRunResultChanged: thisOutcome selector.
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   209
    ^self
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   210
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   211
    "Created: / 20-08-2011 / 12:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
445
874deaef2599 changed:
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   212
    "Modified: / 04-06-2012 / 16:19:07 / cg"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   213
!
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   214
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   215
rememberedOutcomeFor: selector
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   216
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   217
    lastOutcomes isNil ifTrue:[^nil].
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   218
    ^lastOutcomes
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   219
	detect: [:outcome| outcome testCase selector == selector]
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   220
	ifNone:[nil].
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   221
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   222
    "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
   223
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   224
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   225
resources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   226
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   227
	^#()
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   228
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   229
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   230
shouldFork
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   231
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   232
    ^false
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   233
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   234
    "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
   235
!
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   236
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   237
sunitVersion
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   238
	^'4.0'
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   239
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   240
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   241
testSelector:selector result: result
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   242
    "return true, if the last run of this test had the outcome result"
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   243
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   244
    lastOutcomes isNil ifTrue:[^false].
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   245
    ^ lastOutcomes
607
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   246
        contains:[:any|
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   247
            |tc|
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   248
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   249
            (tc := any testCase) class name = self name
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   250
            and:[tc selector == selector
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   251
            and:[any result == result]]
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   252
        ]
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   253
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   254
    "Created: / 20-08-2011 / 16:15:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
445
874deaef2599 changed:
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   255
    "Modified: / 04-06-2012 / 16:12:17 / cg"
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   256
!
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   257
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   258
testSelectorError:selector
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   259
    "return true, if the last run of this test failed"
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   260
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   261
    ^self testSelector: selector result: (TestResult stateError)
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   262
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   263
    "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
   264
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   265
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   266
testSelectorFailed:selector
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   267
    "return true, if the last run of this test failed"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   268
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   269
    ^self testSelector: selector result: (TestResult stateFail)
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   270
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   271
    "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
   272
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   273
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   274
testSelectorPassed:selector
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   275
    "return true, if the last run of this test passed"
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   276
523
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   277
   ^self testSelector: selector result: (TestResult statePass)
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   278
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   279
    "Created: / 15-03-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   280
!
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   281
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   282
testSelectorSkipped:selector
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   283
    "return true, if the last run of this test was skipped"
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   284
dbbf2521cc0c class: TestCase
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
   285
   ^self testSelector: selector result: (TestResult stateSkip)
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   286
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   287
    "Created: / 15-03-2010 / 17:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
607
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   288
!
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   289
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   290
testSelectorsWithLastOutcomes
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   291
    lastOutcomes isNil ifTrue:[^#()].
8d830a63bfc0 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   292
    ^lastOutcomes collect:[:outcome| outcome testCase selector] as:Set
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   293
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   294
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   295
!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
   296
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   297
buildSuite
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   298
	| suite |
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   299
	self isAbstract
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   300
		ifTrue:
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   301
			[suite := self suiteClass named: self name asString.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   302
			self allSubclasses
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   303
				do: [:each | each isAbstract ifFalse: [suite addTest: each buildSuiteFromSelectors]].
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   304
			^ suite]
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   305
		ifFalse: [^ self buildSuiteFromSelectors]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   306
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   307
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   308
buildSuiteFromMethods: testMethods
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   309
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   310
	^testMethods
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   311
		inject: (self suiteClass named: self name asString)
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   312
		into: [:suite :selector |
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   313
			suite
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   314
				addTest: (self selector: selector);
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   315
				yourself]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   316
!
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
   317
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   318
buildSuiteFromSelectors
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   319
	^self buildSuiteFromMethods: self allTestSelectors
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   320
!
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   321
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   322
suiteClass
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   323
	^TestSuite
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   324
! !
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   325
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   326
!TestCase class methodsFor:'misc ui support'!
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   327
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   328
iconInBrowserSymbol
630
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   329
    "the browser will use this as index into the toolbariconlibrary"
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   330
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   331
    <resource: #programImage>
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   332
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   333
    |lastResult|
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   334
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   335
    self theNonMetaclass isAbstract ifTrue:[^ super iconInBrowserSymbol].
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   336
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   337
    lastResult := self lastTestRunResultOrNil.
578
be4d2b6894b9 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   338
    lastResult notNil ifTrue:[
630
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   339
        lastResult == TestResult statePass ifTrue:[
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   340
            ^ #testCasePassedIcon
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   341
        ].
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   342
        lastResult == TestResult stateFail ifTrue:[
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   343
            ^ #testCaseFailedIcon
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   344
        ].
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   345
        lastResult == TestResult stateError ifTrue:[
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   346
            ^ #testCaseErrorIcon
5b0539adf1c1 comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   347
        ].
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   348
    ].
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   349
    ^ #testCaseClassIcon
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   350
! !
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   351
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   352
!TestCase class methodsFor:'private'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   353
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   354
addSelector: selector to: collection
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   355
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   356
    "Adds given selector from collection. Answers
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   357
     true iff selector was really added"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   358
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   359
    (collection includes: selector)
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   360
	ifTrue:[^ false]
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   361
	ifFalse:[collection add: selector. ^ true]
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   362
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   363
    "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
   364
    "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
   365
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   366
689
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   367
coveredClasses
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   368
    "return a collection of classes which are tested by this suite/case.
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   369
     Do not redefine this; redefine either coveredClassNames or
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   370
     coveredPackageNames 
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   371
     (these return names, to avoid creating
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   372
      a package dependecy due to the class references)
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   373
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   374
     These classes can be instrumented for coverage analysis,
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   375
     before running the suite to provide coverage analysis/report"
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   376
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   377
    |names|
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   378
    
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   379
    (names := self coveredPackageNames) notEmptyOrNil ifTrue:[
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   380
        ^ names 
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   381
            collectAll:[:eachPackageOrPattern |
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   382
                eachPackageOrPattern includesMatchCharacters ifTrue:[
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   383
                    Smalltalk allClassesForWhich:[:cls | (cls package ?'') matches:eachPackageOrPattern].
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   384
                ] ifFalse:[    
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   385
                    Smalltalk allClassesInPackage:eachPackageOrPattern
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   386
                ]
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   387
        ].
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   388
    ].
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   389
    ^ self coveredClassNames collect:[:each | Smalltalk classNamed:each]
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   390
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   391
    "Modified (comment): / 30-08-2017 / 11:09:22 / cg"
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   392
    "Modified: / 29-05-2019 / 01:30:01 / Claus Gittinger"
689
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   393
!
d8d6e704ac8f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   394
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   395
lastTestRunResultChanged: selector
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   396
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   397
    Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector).
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   398
    self changed:#lastTestRunResult with:selector.
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   399
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   400
    "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
   401
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   402
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   403
testSelectors
669
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   404
    "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
   405
669
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   406
    |selectors|
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   407
    
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   408
    selectors := self sunitSelectors 
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   409
                    select: [:each | 'test*' sunitMatch: each].
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   410
    selectors := selectors asOrderedCollection.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   411
    selectors sort.
5c60313710b3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   412
    ^ selectors
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   413
! !
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   414
417
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   415
!TestCase class methodsFor:'queries'!
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   416
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   417
coveredClassNames
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   418
    "should be redefined to return a collection of class names 
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   419
     which are tested by this suite/case. 
600
71cb19568d8b class: TestCase
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   420
     If not redefined, coveredPackageNames should be.
599
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   421
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   422
     These classes can be instrumented for coverage analysis,
600
71cb19568d8b class: TestCase
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   423
     before running the suite to provide coverage analysis/report"
417
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   424
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   425
    ^ #()
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   426
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   427
    "Created: / 06-07-2011 / 21:27:03 / cg"
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   428
    "Modified (comment): / 29-05-2019 / 01:32:23 / Claus Gittinger"
417
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   429
!
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   430
599
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   431
coveredPackageNames
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   432
    "redefine this in a concrete testCase class to return non-nil,
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   433
     to return a collection of packages which are tested by this suite/case.
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   434
     If not redefined, coveredClassNames should be redefined.
624
dcc5bcfd1485 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
   435
     The package names may be glob patterns.
599
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   436
     These classes can be instrumented for coverage analysis,
600
71cb19568d8b class: TestCase
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   437
     before running the suite to provide coverage analysis/report"
599
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   438
400bc2cb5690 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
   439
    ^ nil
636
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   440
!
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   441
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   442
isAbstract
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   443
        "Override to true if a TestCase subclass is Abstract and should not have
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   444
        TestCase instances built from it"
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   445
0687cb5a8fd8 class: RBAbstractClass
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   446
        ^self == TestCase
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   447
!
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   448
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   449
requiredPackageNames
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   450
    "can be redefined to return a collection of packages 
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   451
     which are required to be present when running tests.
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   452
     If not redefined, coveredPackageNames is used."
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   453
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   454
    ^ nil
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   455
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   456
    "Created: / 29-05-2019 / 01:31:59 / Claus Gittinger"
417
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   457
! !
Claus Gittinger <cg@exept.de>
parents: 391
diff changeset
   458
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   459
!TestCase class methodsFor:'quick testing'!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   460
686
7e6f03915ad9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   461
assert: aBooleanOrBlock
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   462
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   463
686
7e6f03915ad9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   464
    ^ self new assert: aBooleanOrBlock
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   465
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   466
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   467
     TestCase assert: true
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   468
    "
686
7e6f03915ad9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   469
7e6f03915ad9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   470
    "Modified (format): / 13-07-2017 / 15:13:29 / cg"
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   471
!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   472
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   473
should: aBlock raise: anError
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   474
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   475
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   476
    ^ self new should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   477
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   478
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   479
     TestCase should:[ self error ] raise: Error
587
570faa368e0d class: TestCase
Stefan Vogel <sv@exept.de>
parents: 578
diff changeset
   480
     TestCase should:[ 22 ] raise: Error
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   481
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   482
! !
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   483
601
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   484
!TestCase class methodsFor:'running'!
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   485
700
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   486
debug
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   487
    "run myself as a suite with debugging; return the result"
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   488
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   489
    ^ self suite debug
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   490
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   491
    "
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   492
     SOAP::XeXMLTests run
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   493
     RegressionTests::OperatingSystemTest run
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   494
    "
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   495
!
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   496
601
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   497
run
688
e2428b24d753 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   498
    "run myself as a suite; return the result"
e2428b24d753 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   499
e2428b24d753 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   500
    ^ self suite run
601
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   501
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   502
    "
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   503
     SOAP::XeXMLTests run
688
e2428b24d753 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   504
     RegressionTests::OperatingSystemTest run
601
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   505
    "
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   506
! !
d8c7bcbd1b66 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   507
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   508
!TestCase class methodsFor:'testing'!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   509
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   510
isTestCaseLike
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   511
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   512
    ^true
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   513
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   514
    "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
   515
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   516
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   517
rememberResult:result
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   518
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   519
    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
   520
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   521
    "Created: / 05-08-2006 / 12:33:08 / cg"
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   522
    "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
   523
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   524
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   525
runTests
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   526
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   527
    ^self suite run
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   528
265
125e4f132d46 remember execution time (needed to generate prober reports)
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   529
    "Modified: / 30-07-2011 / 09:26:11 / cg"
391
fb104ea5136f added: #testSelector:result:
vrany
parents: 390
diff changeset
   530
    "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
   531
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   532
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   533
shouldInheritSelectors
710
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   534
    "I should inherit from an Abstract superclass but not from a concrete one by default, 
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   535
     unless I have no testSelectors in which case I must be expecting to inherit them from my superclass.  
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   536
     If a test case with selectors wants to inherit selectors from a concrete superclass, 
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   537
     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
   538
710
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   539
        ^self ~~ self lookupHierarchyRoot
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   540
                and: [self superclass isAbstract
82df3be055a8 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
   541
                        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
   542
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   543
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   544
!TestCase methodsFor:'accessing'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   545
700
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   546
countTests
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   547
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   548
    ^1
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   549
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   550
    "Created: / 04-08-2011 / 13:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   551
!
2309c94fe81c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 690
diff changeset
   552
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   553
resources
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   554
	"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
   555
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   556
	^self class resources
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   557
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   558
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   559
selector
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   560
	^testSelector
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   561
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   562
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   563
shouldFork
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   564
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   565
    ^self class shouldFork
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   566
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   567
    "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
   568
!
f532271f8daa added testCount to TestCase & TestSuite
vrany
parents: 296
diff changeset
   569
529
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   570
shouldSkip
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   571
    "Returns true, if this testcase should be skipped when a testsuite is run.
648
6d39f37eb1cd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   572
     This only a hint, a test runner is not obliged to respect return value.
6d39f37eb1cd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   573
     To skip a test, mark the method with a <skip> annotation
529
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   574
     Currently, the only user is stx/goodies/builder/reports"
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   575
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   576
    | method |
648
6d39f37eb1cd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   577
    
529
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   578
    method := self class lookupMethodFor: testSelector.
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   579
    method annotationsAt:#ignore orAt: #skip do:[:annotation|
648
6d39f37eb1cd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   580
         ^true
529
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   581
    ].
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   582
    ^false
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   583
6bcbe6998b73 added: #shouldSkip
vrany
parents: 524
diff changeset
   584
    "Created: / 28-11-2012 / 18:03:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
703
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   585
!
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   586
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   587
testCount
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   588
    "obsoleted, because all methods starting with 'test'
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   589
     are considered to be tests; so this is a bad name;
705
8158508603f3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   590
     please use countTests.
8158508603f3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   591
     See TestCase >> isTestSelector:"
703
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   592
7cf6ad732dc9 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 700
diff changeset
   593
    ^ self countTests
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   594
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   595
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   596
!TestCase methodsFor:'accessing & queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   597
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   598
unfinished
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   599
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   600
	"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
   601
! !
97
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   602
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   603
!TestCase methodsFor:'assertions'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   604
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   605
assert:aBlock completesInSeconds:aNumber
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   606
    "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
   607
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   608
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   609
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   610
    |done process semaphore|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   611
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   612
    done := false.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   613
    semaphore := Semaphore new.
174
3fff3dede568 #assert:completedInSeconds:
Stefan Vogel <sv@exept.de>
parents: 139
diff changeset
   614
    process := [
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   615
	aBlock value.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   616
	done := true.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   617
	semaphore signal
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   618
    ] fork.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   619
    semaphore waitWithTimeout: aNumber.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   620
    process terminate.
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   621
    self assert: done
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   622
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   623
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   624
     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
   625
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   626
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   627
     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
   628
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   629
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   630
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   631
assert: aBoolean message:messageIfFailing
531
13776d5be378 class: TestCase
vrany
parents: 529
diff changeset
   632
     <resource: #skipInDebuggersWalkBack>
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   633
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   634
    ^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
   635
531
13776d5be378 class: TestCase
vrany
parents: 529
diff changeset
   636
    "Modified: / 15-12-2012 / 17:20:31 / 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
   637
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   638
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   639
assertFalse:aBoolean
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   640
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   641
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   642
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   643
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   644
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   645
assertFalse:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   646
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   647
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   648
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   649
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   650
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   651
assertTrue:aBoolean
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   652
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
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
    ^ self assert:aBoolean
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
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   657
assertTrue:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   658
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   659
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   660
    ^ self assert:aBoolean
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   661
! !
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   662
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   663
!TestCase methodsFor:'dependencies'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   664
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   665
addDependentToHierachy: anObject
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   666
	"an empty method. for Composite compability with TestSuite"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   667
!
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   668
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   669
removeDependentFromHierachy: anObject
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   670
	"an empty method. for Composite compability with TestSuite"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   671
! !
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   672
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   673
!TestCase methodsFor:'deprecated'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   674
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   675
should: aBlock
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   676
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   677
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   678
    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
   679
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   680
712
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   681
should:result be:expected 
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   682
    <resource: #skipInDebuggersWalkBack>
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   683
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   684
    ^ self assert: (result = expected) 
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   685
           description: 'should be ' , expected asString , ', but it''s ' , result asString
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   686
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   687
    "
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   688
     self new should:5 be:6
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   689
    "
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   690
!
61e5116a2649 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
   691
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   692
should: aBlock description: aString
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   693
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   694
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   695
    self assert: aBlock value description: aString
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   696
!
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   697
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   698
shouldnt: aBlock
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   699
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   700
    self deny: aBlock value
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   701
!
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   702
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   703
shouldnt: aBlock description: aString
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   704
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   705
    self deny: aBlock value description: aString
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   706
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   707
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   708
signalFailure: aString
707
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   709
    <resource: #skipInDebuggersWalkBack>
cf2be5373855 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   710
    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
   711
! !
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   712
733
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   713
!TestCase methodsFor:'initialize / release'!
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   714
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   715
setUp
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   716
    "can be redefined in a concrete test"
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   717
!
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   718
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   719
tearDown
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   720
    "can be redefined in a concrete test"
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   721
! !
89e7550d114b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 731
diff changeset
   722
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   723
!TestCase methodsFor:'printing'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   724
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   725
getTestName
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   726
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   727
    ^testSelector.
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   728
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   729
    "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
   730
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   731
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   732
name
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   733
	^ self class name.
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   734
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   735
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   736
printOn: aStream
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   737
	self class printOn:aStream.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   738
	aStream nextPutAll: '>>#'.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   739
	testSelector printOn:aStream.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   740
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   741
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   742
!TestCase methodsFor:'private'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   743
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   744
ensureRequiredPackagesAreLoaded
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   745
    |names|
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   746
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   747
    (names := self class requiredPackageNames) isNil ifTrue:[
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   748
        (names := self class coveredPackageNames)
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   749
    ].
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   750
    names notEmptyOrNil ifTrue:[
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   751
        "/ ensure that the packages are loaded
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   752
        names do:[:each |
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   753
            (Smalltalk loadPackage:each) ifFalse:[
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   754
                self error:('package not loaded: %1' bindWith:each)
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   755
            ].
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   756
        ].    
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   757
    ].
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   758
    self setUp
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   759
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   760
    "Created: / 29-05-2019 / 01:32:58 / Claus Gittinger"
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   761
!
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   762
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   763
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
   764
"/        ^[aBlock value.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   765
"/        false] sunitOn: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   766
"/                do: [:ex | ex sunitExitWith: true]
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   767
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   768
"/        [[aBlock value]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   769
"/                on: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   770
"/                do: [:ex | ^true]]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   771
"/                        on: TestResult exError
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   772
"/                        do: [:ex | ^false].
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   773
	[aBlock value]
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   774
		on: anExceptionalEvent
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   775
		do: [:ex | ^true].
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   776
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   777
	^false.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   778
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   779
747
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   780
invokeTestMethod
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   781
    self perform: testSelector sunitAsSymbol
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   782
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   783
    "Created: / 29-05-2019 / 00:40:03 / Claus Gittinger"
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   784
!
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   785
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   786
performTest
747
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   787
    <modifier: #super> "must be called if redefined"
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   788
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   789
    "handle unimplemented #should message,
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   790
     so we can write:
747
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   791
        something should be:expectedResult
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   792
    "
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   793
    MessageNotUnderstood handle:[:ex |
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   794
        ex selector == #should ifTrue:[
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   795
            ex proceedWith:( Should new testCase:self; value:ex receiver )
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   796
        ].    
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   797
        ex reject.
747
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   798
    ] do:[
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   799
        |mthd timeoutAllotation maxSecondsToRun timeoutOccurred|
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   800
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   801
        timeoutOccurred := false.
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   802
        mthd := self class lookupMethodFor:testSelector.
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   803
        mthd notNil ifTrue:[
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   804
            (timeoutAllotation := mthd annotationAt:#timeout:) notNil ifTrue:[
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   805
                (maxSecondsToRun := timeoutAllotation argumentAt:1 ifAbsent:[nil]) isNil ifTrue:[
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   806
                    Logger warning:'bad timeout annotation in %1' with:mthd whoString.
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   807
                ].    
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   808
            ].    
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   809
        ].
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   810
        maxSecondsToRun notNil ifTrue:[
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   811
            [
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   812
                self invokeTestMethod
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   813
            ] valueWithWatchDog:[timeoutOccurred := true] afterMilliseconds:(maxSecondsToRun * 1000).
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   814
        ] ifFalse:[    
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   815
            self invokeTestMethod
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   816
        ].
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   817
        timeoutOccurred ifTrue:[
750
1719905cad36 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   818
            self error:('test did not complete within %1 seconds (timeout)' bindWith:maxSecondsToRun)
747
1dcb53cf964d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   819
        ].    
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   820
    ].
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
   821
750
1719905cad36 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   822
    "Modified: / 29-05-2019 / 02:07:34 / Claus Gittinger"
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   823
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   824
576
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   825
safeTearDown
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   826
    "Have to handle Abort. When tearDown is called as inside an ensure block after
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   827
     an abort in the debugger of an errornous test case and raises an error with a debugger
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   828
     itself."
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   829
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   830
    AbortOperationRequest handle:[:ex| ] do:[self tearDown].
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   831
!
55ef6aaf19cb class: TestCase
Stefan Vogel <sv@exept.de>
parents: 575
diff changeset
   832
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   833
setTestSelector: aSymbol
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   834
	testSelector := aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   835
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   836
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   837
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
   838
    "/        TestResult failure sunitSignalWith: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   839
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   840
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   841
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   842
    isResumable ifTrue:[
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   843
	TestResult resumableFailure
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   844
	    raiseRequestWith:nil
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   845
	    errorString:aString
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   846
	    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
   847
    ] ifFalse:[
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   848
	TestResult failure
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   849
	    raiseErrorString:aString
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   850
	    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
   851
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   852
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   853
    "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
   854
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   855
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   856
signalUnavailableResources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   857
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   858
    self resources do:[:res |
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   859
	res isAvailable ifFalse:[
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   860
	    ^ res signalInitializationError
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   861
	]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   862
    ].
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   863
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   864
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   865
!TestCase methodsFor:'queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   866
690
cb50d1d3ffeb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   867
isLogging
728
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   868
    "By default, we're not logging failures. If you override this in
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   869
     a subclass, make sure that you override #failureLog"
690
cb50d1d3ffeb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   870
728
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   871
    ^ self class isLogging
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   872
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   873
    "Modified: / 22-03-2019 / 12:48:09 / Claus Gittinger"
690
cb50d1d3ffeb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   874
!
cb50d1d3ffeb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   875
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   876
isTestCase
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   877
    ^ true
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   878
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   879
221
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   880
isTestCaseLike
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   881
    ^ true
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   882
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   883
    "Created: / 29-06-2011 / 20:37:57 / cg"
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   884
!
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   885
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   886
isTestSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   887
    ^ false
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   888
! !
122
61e456491017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   889
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   890
!TestCase methodsFor:'running'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   891
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   892
debug
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   893
587
570faa368e0d class: TestCase
Stefan Vogel <sv@exept.de>
parents: 578
diff changeset
   894
    | testCase outcome result wasProceeded|
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   895
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   896
    [
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   897
        result := TestResult stateError.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   898
        wasProceeded := false.
587
570faa368e0d class: TestCase
Stefan Vogel <sv@exept.de>
parents: 578
diff changeset
   899
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   900
        [
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   901
            (testCase := self class selector: testSelector) runCase.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   902
            wasProceeded ifFalse:[
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   903
                result := TestResult statePass.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   904
            ]
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   905
        ] sunitOn:(TestResult failure) do: [:ex |
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   906
            ex creator == TestSkipped ifTrue:[
731
8980c4ec29ec #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   907
                TestSkipped isHandled ifTrue:[ex reject].
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   908
                result := TestResult stateSkip.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   909
            ] ifFalse:[
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   910
                result := TestResult stateFail.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   911
            ].
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   912
            "I want a debugger to open here..."
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   913
            "the only really portable dialect query..."
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   914
            ((Smalltalk respondsTo:#isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifTrue:[
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   915
                "/ debug
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   916
                Debugger
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   917
                    enter:ex raiseContext
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   918
                    withMessage:(ex description)
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   919
                    mayProceed:true.
706
1c3bc0e12b31 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   920
                ex creator == TestSkipped ifTrue:[ex return].
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   921
                wasProceeded := true.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   922
                ex proceed.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   923
            ] ifFalse:[
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   924
                "is there a portable way to open a debugger?"
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   925
                self halt:(ex description).
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   926
                wasProceeded := true.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   927
            ].
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   928
        ].
524
5cf0a462356a lastState fixes
Claus Gittinger <cg@exept.de>
parents: 523
diff changeset
   929
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   930
    ] ensure: [
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   931
        " if proceeded in the debugger, we arrive here; "
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   932
        " but still, this is not always a pass !! "
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   933
        outcome := TestCaseOutcome new.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   934
        outcome testCase: testCase.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   935
        outcome result: result.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   936
        outcome remember.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   937
        TestResource resetResources: self resources
382
05683696d647 Fixs in remembering test outcomes
vrany
parents: 377
diff changeset
   938
    ].
254
7f4b9fc9756b changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents: 240
diff changeset
   939
7f4b9fc9756b changed: #debug - remembers test as passed if no error occur during debugging
vrany
parents: 240
diff changeset
   940
    "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
   941
    "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
   942
    "Modified: / 20-08-2011 / 14:15:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   943
    "Modified: / 13-07-2017 / 14:02:47 / cg"
731
8980c4ec29ec #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
   944
    "Modified: / 23-03-2019 / 10:15:15 / Claus Gittinger"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   945
!
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   946
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   947
debugAsFailure
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   948
	| semaphore |
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   949
	semaphore := Semaphore new.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   950
	[semaphore wait. TestResource resetResources: self resources] fork.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   951
	(self class selector: testSelector) runCaseAsFailure: semaphore.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   952
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   953
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   954
debugUsing:aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   955
    self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   956
    [
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   957
	"/ used to be:
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   958
	"/  (self class selector:testSelector) perform:aSymbol
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   959
	"/ which is bad for subclasses which need more arguments.
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   960
	"/ why not use:
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   961
	"/  self copy perform:aSymbol
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   962
	"/ or even
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   963
	"/  self perform:aSymbol
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   964
	self perform:aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   965
    ] ensure:[
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   966
	self resources do:[:each |
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   967
	    each reset
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   968
	]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   969
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   970
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   971
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   972
failureLog
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   973
	^SUnitNameResolver class >> #defaultLogDevice
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   974
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   975
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   976
logFailure: aString
728
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   977
    self isLogging ifTrue: [
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   978
        self failureLog cr; nextPutAll: aString; flush
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   979
    ]
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   980
728
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   981
    "Modified (format): / 22-03-2019 / 12:49:30 / Claus Gittinger"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   982
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   983
550
cf72a67f1973 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   984
logSkipped: aString
728
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   985
    self isLogging ifTrue: [
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   986
        self failureLog cr; nextPutAll: aString; flush
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   987
    ]
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   988
c628d3d488f1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   989
    "Modified (format): / 22-03-2019 / 12:49:40 / Claus Gittinger"
550
cf72a67f1973 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   990
!
cf72a67f1973 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   991
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   992
openDebuggerOnFailingTestMethod
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   993
	"SUnit has halted one step in front of the failing test method. Step over the 'self halt' and
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   994
	 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
   995
594
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   996
	self
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   997
		"/halt;
617433e967e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   998
		performTest
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   999
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1000
    "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
  1001
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
  1002
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
  1003
run
688
e2428b24d753 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1004
    "run this suite; return the result"
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1005
461
c4a68cc4e547 use TestResultForSTX in SUnit runner
Claus Gittinger <cg@exept.de>
parents: 454
diff changeset
  1006
    ^self run: TestResult defaultResultClass new
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1007
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1008
    "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
  1009
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
  1010
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
  1011
run: aResult
688
e2428b24d753 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1012
    "run this suite; fill and return aResult"
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1013
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1014
    ^self run: aResult beforeEachDo: [:test :result|] afterEachDo: [:test :result|]
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1015
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1016
    "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
  1017
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
  1018
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1019
run: aResult afterEachDo:block2
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1020
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1021
    ^self run: aResult beforeEachDo: [:test :result|] afterEachDo:block2
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1022
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1023
    "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
  1024
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1025
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1026
run: aResult beforeEachDo:block1 afterEachDo:block2
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1027
    "run and fill (update) aResult"
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1028
    
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1029
    ^ self 
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1030
        run:aResult 
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1031
        beforeEachDo:block1 
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1032
        afterEachDo:block2 
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1033
        resetResources:true
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1034
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1035
    "Modified: / 29-07-2011 / 12:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1036
    "Modified (comment): / 28-03-2019 / 13:22:02 / Claus Gittinger"
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1037
!
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1038
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1039
run:aResult beforeEachDo:before afterEachDo:after resetResources:reset
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1040
    "run and fill (update) aResult"
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1041
430
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1042
    ^ self
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1043
        run:aResult
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1044
        beforeEachDo:before
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1045
        afterEachDo:after
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1046
        resetResources:reset
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1047
        debug:false
430
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1048
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1049
    "Created: / 29-07-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1050
    "Modified: / 21-08-2011 / 17:45:17 / cg"
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1051
    "Modified (comment): / 28-03-2019 / 13:22:55 / Claus Gittinger"
430
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1052
!
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1053
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1054
run:result beforeEachDo:before afterEachDo:after resetResources:reset debug:doDebug
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1055
    "Workhorse for running a testcase and updating result.
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1056
     If reset is true, then
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1057
     the resources are reset, otherwise not"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1058
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1059
    "1. Execute before block"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1060
    "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
  1061
     it is more portable - numArgs in ANSI (?)"
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1062
    Smalltalk isSmalltalkX ifTrue:[ 
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1063
        before valueWithOptionalArgument:self and:result.   
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1064
    ] ifFalse:[
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1065
        before numArgs == 2 ifTrue:[
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1066
            before value: self value: result
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1067
        ] ifFalse:[
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1068
            before numArgs == 1 ifTrue:[
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1069
                before value: self
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1070
            ] ifFalse:[
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1071
                before value.
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1072
            ]
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1073
        ].
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1074
    ].
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1075
    
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1076
    "2. Run the testcase"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1077
    reset ifTrue:[
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1078
        [
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1079
            result runCase:self debugged:doDebug
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1080
        ] ensure: [
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1081
            TestResource resetResources: self resources
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1082
        ].
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1083
    ] ifFalse:[
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1084
        result runCase:self debugged:doDebug
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1085
    ].
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1086
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1087
    "3. Execute after block"
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1088
    "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
  1089
     it is more portable - numArgs in ANSI (?)"
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1090
    Smalltalk isSmalltalkX ifTrue:[ 
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1091
        after valueWithOptionalArgument:self and:result.
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1092
    ] ifFalse:[    
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1093
        after numArgs == 2 ifTrue:[
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1094
            after value: self value: result
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1095
        ] ifFalse:[
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1096
            after numArgs == 1 ifTrue:[
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1097
                after value: self
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1098
            ] ifFalse:[
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1099
                after value.
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1100
            ]
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1101
        ].
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1102
    ].
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1103
    ^result
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1104
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1105
    "Created: / 29-07-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
430
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
  1106
    "Created: / 21-08-2011 / 17:44:56 / cg"
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1107
    "Modified: / 13-07-2017 / 14:02:53 / cg"
737
a4f9d8da94aa #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 733
diff changeset
  1108
    "Modified: / 28-03-2019 / 11:16:47 / Claus Gittinger"
745
418e472d0744 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1109
    "Modified (format): / 28-03-2019 / 13:26:15 / Claus Gittinger"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1110
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1111
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1112
run: aResult beforeEachTestCaseDo:block1 afterEachTestCaseDo:block2
262
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1113
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1114
    <resource: #obsolete>
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1115
    self obsoleteMethodWarning: 'Use #run:beforeEachDo:afterEachDo: instead'.
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1116
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1117
    ^self run: aResult beforeEachDo:block1 afterEachDo:block2
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1118
3c46acd3f64a TestSuite/TestCase run* method refactored (cleanup, possible bug fixes)
vrany
parents: 254
diff changeset
  1119
    "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
  1120
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1121
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1122
runCase
570
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1123
    |didSetup|
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1124
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1125
    self ensureRequiredPackagesAreLoaded.
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
  1126
    self resources do: [:each | each availableFor: self].
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
  1127
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
  1128
    [
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1129
        didSetup := false.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1130
        self setUp.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1131
        didSetup := true.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1132
        self performTest.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1133
    ] ensure: [
713
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1134
        didSetup 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1135
            ifTrue:[ self safeTearDown ]
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1136
            ifFalse:[ 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1137
                "/ can we tearDown here????
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1138
                Transcript showCR:'error in setup - no teardown' 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1139
                "/ self error:'error in setup' 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1140
            ].
328
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
  1141
    ]
66cae160c956 added: #withStandardOutputAndTranscriptRedirectedDo:
Claus Gittinger <cg@exept.de>
parents: 326
diff changeset
  1142
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1143
    "Modified: / 13-07-2017 / 14:03:01 / cg"
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1144
    "Modified: / 29-05-2019 / 01:34:01 / Claus Gittinger"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1145
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1146
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1147
runCaseAsFailure
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1148
    self ensureRequiredPackagesAreLoaded.
570
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1149
    self setUp.
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1150
    [
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1151
        [self openDebuggerOnFailingTestMethod] ensure: [self safeTearDown]
570
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1152
    ] fork
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1153
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1154
    "Modified: / 21-06-2000 / 10:04:33 / Sames"
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1155
    "Modified: / 29-05-2019 / 01:34:10 / Claus Gittinger"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1156
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1157
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1158
runCaseAsFailure: aSemaphore
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1159
    self ensureRequiredPackagesAreLoaded.
570
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1160
    [
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1161
        |didSetup|
570
c9c4c97948cc class: TestCase
Claus Gittinger <cg@exept.de>
parents: 565
diff changeset
  1162
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1163
        didSetup := false.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1164
        self resources do: [:each | each availableFor: self].
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1165
        [
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1166
            self setUp.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1167
            didSetup := true.
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1168
            self openDebuggerOnFailingTestMethod
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1169
        ] ensure: [
713
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1170
            didSetup 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1171
                ifTrue:[ self tearDown ]
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1172
                ifFalse:[ 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1173
                    "/ can we tearDown here????
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1174
                    Transcript showCR:'error in setup - no teardown' 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1175
                    "/ self error:'error in setup' 
75290ec5aa59 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
  1176
                ].
685
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1177
        ]
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1178
    ] ensure: [aSemaphore signal].
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1179
00195d0e5ebc #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1180
    "Modified: / 13-07-2017 / 14:03:44 / cg"
749
d8addd588fc0 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
  1181
    "Modified: / 29-05-2019 / 01:34:30 / Claus Gittinger"
50
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  1182
! !
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
  1183
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1184
!TestCase::Should class methodsFor:'documentation'!
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1185
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1186
documentation
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1187
"
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1188
    documentation to be added.
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1189
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1190
    [author:]
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1191
        Claus Gittinger
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1192
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1193
    [instance variables:]
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1194
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1195
    [class variables:]
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1196
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1197
    [see also:]
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1198
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1199
"
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1200
! !
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1201
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1202
!TestCase::Should methodsFor:'accessing'!
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1203
719
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1204
assertSelector
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1205
    ^ assertSelector ? #'assert:'
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1206
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1207
    "Created: / 01-07-2018 / 12:42:00 / Claus Gittinger"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1208
!
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1209
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1210
testCase:something
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1211
    testCase := something.
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1212
!
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1213
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1214
value:something
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1215
    value := something.
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1216
! !
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1217
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1218
!TestCase::Should methodsFor:'verifying'!
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1219
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1220
be:expectedValue
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1221
    "for expressions like:
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1222
        value should be:expectedValue
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1223
     inside a testcase"
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1224
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1225
    <resource: #skipInDebuggersWalkBack>
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1226
719
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1227
    testCase perform:self assertSelector with:(value = expectedValue).
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1228
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1229
    "Created: / 01-07-2018 / 12:11:46 / Claus Gittinger"
719
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1230
!
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1231
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1232
beInstanceOf:expectedClass
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1233
    "for expressions like:
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1234
        value should be:expectedValue
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1235
     inside a testcase"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1236
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1237
    <resource: #skipInDebuggersWalkBack>
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1238
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1239
    testCase perform:self assertSelector with:(value class == expectedClass).
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1240
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1241
    "Created: / 01-07-2018 / 12:38:38 / Claus Gittinger"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1242
!
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1243
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1244
equal:expectedValue
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1245
    "for expressions like:
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1246
        value should equal:expectedValue
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1247
     inside a testcase"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1248
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1249
    <resource: #skipInDebuggersWalkBack>
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1250
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1251
    testCase perform:self assertSelector with:(value = expectedValue).
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1252
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1253
    "Created: / 01-07-2018 / 12:30:08 / Claus Gittinger"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1254
!
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1255
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1256
not
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1257
    assertSelector := #deny:
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1258
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1259
    "Created: / 01-07-2018 / 12:42:12 / Claus Gittinger"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1260
!
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1261
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1262
raise:exceptionClass
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1263
    "for expressions like:
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1264
        value should be:expectedValue
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1265
     inside a testcase"
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1266
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1267
    <resource: #skipInDebuggersWalkBack>
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1268
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1269
    self assertSelector == #assert: ifTrue:[
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1270
        testCase should:value raise:exceptionClass
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1271
    ] ifFalse:[
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1272
        self assertSelector == #deny: ifTrue:[
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1273
            testCase shouldnt:value raise:exceptionClass
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1274
        ] ifFalse:[
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1275
            self error.
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1276
        ].    
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1277
    ].
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1278
2c96860ad5cb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
  1279
    "Created: / 01-07-2018 / 12:39:48 / Claus Gittinger"
717
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1280
! !
31366612f433 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  1281
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  1282
!TestCase class methodsFor:'documentation'!
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  1283
290
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  1284
version
623
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
  1285
    ^ '$Header$'
290
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  1286
!
7b52b68d57cb changed: #isTestSelector:
Claus Gittinger <cg@exept.de>
parents: 288
diff changeset
  1287
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
  1288
version_CVS
623
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
  1289
    ^ '$Header$'
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1290
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1291
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1292
version_SVN
623
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
  1293
    ^ '$Id$'
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
  1294
! !
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
  1295
550
cf72a67f1973 class: TestCase
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
  1296
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
  1297
TestCase initialize!