TestCase.st
author Claus Gittinger <cg@exept.de>
Wed, 29 Jun 2011 20:38:32 +0200
changeset 221 914934672e32
parent 216 0b7c8dc16ed4
child 222 8e6f482297fa
permissions -rw-r--r--
added: #isTestCaseLike
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
     1
"{ Package: 'stx:goodies/sunit' }"
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
Object subclass:#TestCase
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	instanceVariableNames:'testSelector'
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	classVariableNames:''
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	poolDictionaries:''
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 4
diff changeset
     7
	category:'SUnit-Base'
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    10
TestCase class instanceVariableNames:'lastTestRunResultOrNil lastTestRunsFailedTests'
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    11
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    12
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    13
 No other class instance variables are inherited by this class.
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    14
"
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    15
!
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
    16
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    17
TestCase comment:'A TestCase is a Command representing the future running of a test case. Create one with the class method #selector: aSymbol, passing the name of the method to be run when the test case runs.
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    18
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    19
When you discover a new fixture, subclass TestCase, declare instance variables for the objects in the fixture, override #setUp to initialize the variables, and possibly override# tearDown to deallocate any external resources allocated in #setUp.
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    20
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    21
When you are writing a test case method, send #assert: aBoolean when you want to check for an expected value. For example, you might say "self assert: socket isOpen" to test whether or not a socket is open at a point in a test.'
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    22
!
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    23
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    24
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    25
!TestCase class methodsFor:'initialization'!
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    26
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    27
initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    28
    ResumableTestFailure autoload
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    29
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    30
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    31
     self initialize
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    32
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    33
! !
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    34
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    35
!TestCase class methodsFor:'instance creation'!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    36
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    37
debug: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    38
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    39
	^(self selector: aSymbol) debug
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    40
			
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    41
!
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
    42
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    43
run: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    44
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    45
	^(self selector: aSymbol) run
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    46
			
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    47
!
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
    48
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
selector: aSymbol
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    50
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 4
diff changeset
    51
	^self new setTestSelector: aSymbol
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    52
			
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    53
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    54
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    55
suite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    56
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    57
	^self buildSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    58
			
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
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
!TestCase class methodsFor:'accessing'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    62
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    63
allTestSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    64
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    65
        ^ (self allSelectors select: [:each | self isTestSelector:each]) asOrderedCollection sort
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    66
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    67
    "Modified: / 06-08-2006 / 11:46:32 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    68
!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
    69
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    70
forgetLastTestRunResult
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    71
    lastTestRunResultOrNil ~~ nil ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    72
        lastTestRunResultOrNil := nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    73
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    74
        self changed:#lastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    75
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    76
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    77
    "Modified: / 06-08-2006 / 11:40:07 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    78
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    79
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    80
isTestSelector:aSelector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    81
200
bfceaad3c3cc patch from Jan Vrany
fm
parents: 197
diff changeset
    82
    ^aSelector ~= #testName 
bfceaad3c3cc patch from Jan Vrany
fm
parents: 197
diff changeset
    83
        and:[aSelector startsWith: 'test']
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    84
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    85
    "Created: / 06-08-2006 / 11:46:17 / cg"
200
bfceaad3c3cc patch from Jan Vrany
fm
parents: 197
diff changeset
    86
    "Modified: / 19-08-2009 / 14:42:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    87
!
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
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
lastTestRunResultOrNil
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    90
    ^ lastTestRunResultOrNil
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    91
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
    92
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    93
rememberFailedTest:selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    94
    lastTestRunsFailedTests isNil ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    95
        lastTestRunsFailedTests := Set new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    96
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    97
    
208
c32437e0f7b8 code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    98
    (lastTestRunsFailedTests includes:selector) ifFalse:[
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    99
        lastTestRunsFailedTests add:selector.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   100
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   101
        self changed:#lastTestRunResult with:selector.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   102
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   103
    self rememberFailedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   104
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   105
    "Modified: / 06-08-2006 / 11:01:08 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   106
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   107
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   108
rememberFailedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   109
    lastTestRunResultOrNil ~~ false ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   110
        lastTestRunResultOrNil := false.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   111
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   112
        self changed:#lastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   113
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   114
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   115
    "Modified: / 06-08-2006 / 11:00:42 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   116
!
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   117
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   118
rememberFailedTestRunWithResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   119
    self rememberFailedTestRun.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   120
    self rememberFailedTestsFromResult:result.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   121
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   122
    "Modified: / 05-08-2006 / 12:45:19 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   123
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
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
rememberFailedTestsFromResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   126
    (result failures union:result errors) do:[:eachFailedTest |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   127
        self rememberFailedTest:(eachFailedTest selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   128
    ].
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
    "Created: / 05-08-2006 / 12:45:01 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   131
    "Modified: / 06-08-2006 / 10:54:31 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   132
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   133
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   134
rememberPassedTest:selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   135
    lastTestRunsFailedTests notNil ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   136
        (lastTestRunsFailedTests includes:selector) ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   137
            lastTestRunsFailedTests remove:selector ifAbsent:nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   138
            Smalltalk changed:#lastTestRunResult with:(Array with:self with:selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   139
            self changed:#lastTestRunResult with:selector.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   140
            lastTestRunsFailedTests isEmpty ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   141
                lastTestRunsFailedTests := nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   142
                self forgetLastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   143
            ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   144
        ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   145
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   146
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   147
    "Modified: / 06-08-2006 / 11:40:16 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   148
!
87
24e88e7f5d88 remember individual failed cases.
Claus Gittinger <cg@exept.de>
parents: 82
diff changeset
   149
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   150
rememberPassedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   151
    lastTestRunResultOrNil ~~ true ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   152
        lastTestRunResultOrNil := true.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   153
        lastTestRunsFailedTests := nil.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   154
        Smalltalk changed:#lastTestRunResult with:(Array with:self with:nil).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   155
        self changed:#lastTestRunResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   156
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   157
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   158
    "Modified: / 06-08-2006 / 11:01:22 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   159
!
131
86ad122e57f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   160
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   161
rememberPassedTestsFromResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   162
    (result passed) do:[:eachPassedTest |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   163
        self rememberPassedTest:(eachPassedTest selector).
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   164
    ].
131
86ad122e57f6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   165
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   166
    "Created: / 06-08-2006 / 10:29:47 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   167
    "Modified: / 06-08-2006 / 11:42:01 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   168
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   169
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   170
resources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   171
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   172
	^#()
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   173
			
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   174
!
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   175
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   176
sunitVersion
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   177
	^'3.1'
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   178
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   179
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   180
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   181
testSelectorFailed:selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   182
    ^ lastTestRunsFailedTests notNil and:[lastTestRunsFailedTests includes:selector]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   183
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   184
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   185
testSelectors
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   186
    "the default here is all methods in a test*-category;
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   187
     this can, of course, be redefined in a testCase-class, which knows better"
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   188
211
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   189
    ^ (self selectors select: [:each | 'test*' match: each]) asOrderedCollection sort
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   190
3a40b828ce9a comment/format in: #testSelectors
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   191
    "Modified: / 24-04-2010 / 14:04:51 / cg"
216
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   192
!
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   193
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   194
testedClasses
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   195
    "for the browser and for coverage analysis:
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   196
     return a collection of classNames, which are tested by this testCase"
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   197
0b7c8dc16ed4 added: #testedClasses
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
   198
    ^ #()
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   199
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   200
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   201
!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
   202
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   203
buildSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   204
	| suite |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   205
	^self isAbstract
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   206
		ifTrue: 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   207
			[suite := self suiteClass named: self name asString.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   208
			self allSubclasses 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   209
				do: [:each | each isAbstract ifFalse: [suite addTest: each buildSuiteFromSelectors]].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   210
			suite]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   211
		ifFalse: [self buildSuiteFromSelectors]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   212
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   213
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   214
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   215
buildSuiteFromAllSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   216
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   217
	^self buildSuiteFromMethods: self allTestSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   218
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   219
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   220
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   221
buildSuiteFromLocalSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   222
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   223
	^self buildSuiteFromMethods: self testSelectors
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
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   226
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   227
buildSuiteFromMethods: testMethods
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   228
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   229
	^testMethods
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   230
		inject: (self suiteClass named: self name asString)
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   231
		into: [:suite :selector |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   232
			suite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   233
				addTest: (self selector: selector);
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   234
				yourself]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   235
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   236
!
138
90efce9992ea *** empty log message ***
boris
parents: 131
diff changeset
   237
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   238
buildSuiteFromSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   239
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   240
	^self shouldInheritSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   241
		ifTrue: [self buildSuiteFromAllSelectors]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   242
		ifFalse: [self buildSuiteFromLocalSelectors]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   243
			
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   244
!
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   245
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   246
suiteClass
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   247
	^TestSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   248
			
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   249
! !
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 67
diff changeset
   250
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   251
!TestCase class methodsFor:'misc ui support'!
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   252
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   253
iconInBrowserSymbol
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   254
    <resource: #programImage>
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   255
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   256
    |lastResult|
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   257
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   258
    self theNonMetaclass isAbstract ifTrue:[^ super iconInBrowserSymbol].
205
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   259
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   260
    lastResult := self lastTestRunResultOrNil.
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   261
    lastResult == true ifTrue:[
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   262
        ^ #testCasePassedIcon
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   263
    ].
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   264
    lastResult == false ifTrue:[
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   265
        ^ #testCaseFailedIcon
2236d74e0703 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   266
    ].
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   267
    ^ #testCaseClassIcon
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   268
! !
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   269
197
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   270
!TestCase class methodsFor:'quick testing'!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   271
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   272
assert: aBoolean
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   273
    ^ self new assert: aBoolean
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   274
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   275
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   276
     TestCase assert: true
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   277
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   278
!
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   279
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   280
should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   281
    ^ self new should: aBlock raise: anError
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   282
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   283
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   284
     TestCase should:[ self error ] raise: Error
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   285
    "
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   286
! !
f44d22a08808 quick tests
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
   287
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   288
!TestCase class methodsFor:'testing'!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   289
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   290
isAbstract
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   291
    "Override to true if a TestCase subclass is Abstract and should not have
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   292
     TestCase instances built from it"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   293
    
181
defd10047d9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   294
    ^ self == TestCase
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   295
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   296
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   297
rememberResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   298
    result hasPassed ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   299
        self rememberPassedTestRun
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   300
    ] ifFalse:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   301
        self rememberFailedTestRunWithResult:result
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   302
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   303
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   304
    "Created: / 05-08-2006 / 12:33:08 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   305
!
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
runTests
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   308
    |result|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   309
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   310
    result := self suite run.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   311
    self rememberResult:result.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   312
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   313
    "Modified: / 05-08-2006 / 12:33:20 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   314
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   315
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   316
shouldInheritSelectors
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   317
	"I should inherit from an Abstract superclass but not from a concrete one by default, unless I have no testSelectors in which case I must be expecting to inherit them from my superclass.  If a test case with selectors wants to inherit selectors from a concrete superclass, override this to true in that subclass."
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   318
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   319
	^self superclass isAbstract
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   320
		or: [self testSelectors isEmpty]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   321
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   322
"$QA Ignore:Sends system method(superclass)$"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   323
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   324
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   325
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   326
!TestCase methodsFor:'accessing'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   327
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   328
resources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   329
	| allResources resourceQueue |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   330
	allResources := Set new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   331
	resourceQueue := OrderedCollection new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   332
	resourceQueue addAll: self class resources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   333
	[resourceQueue isEmpty] whileFalse: [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   334
		| next |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   335
		next := resourceQueue removeFirst.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   336
		allResources add: next.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   337
		resourceQueue addAll: next resources].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   338
	^allResources
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   339
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   340
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   341
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   342
selector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   343
	^testSelector
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   344
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   345
! !
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   346
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   347
!TestCase methodsFor:'accessing & queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   348
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   349
unfinished
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   350
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   351
	"indicates an unfinished test"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   352
! !
97
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   353
1f7ff8664715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   354
!TestCase methodsFor:'assertions'!
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   355
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   356
assert: aBoolean
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   357
    "fail, if the argument is not true"
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   358
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   359
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   360
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   361
"/        aBoolean ifFalse: [self signalFailure: 'Assertion failed']
69
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   362
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   363
    self assert: aBoolean message:'Assertion failed'
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   364
!
c5bff082e12f added #assert:message:
james
parents: 68
diff changeset
   365
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   366
assert:aBlock completesInSeconds:aNumber
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   367
    "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
   368
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   369
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   370
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   371
    |done process semaphore|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   372
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   373
    done := false.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   374
    semaphore := Semaphore new.
174
3fff3dede568 #assert:completedInSeconds:
Stefan Vogel <sv@exept.de>
parents: 139
diff changeset
   375
    process := [
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   376
        aBlock value.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   377
        done := true.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   378
        semaphore signal
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   379
    ] fork.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   380
    semaphore waitWithTimeout: aNumber.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   381
    process terminate.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   382
    self assert: done       
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   383
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   384
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   385
     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
   386
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   387
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   388
     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
   389
    "
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   390
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   391
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   392
assert:aBoolean description:aString 
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   393
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   394
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   395
    aBoolean ifFalse:[
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   396
        self logFailure:aString.
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   397
        self signalFailure:aString resumable:true
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   398
    ]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   399
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   400
    "Modified: / 06-08-2006 / 22:56:27 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   401
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   402
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   403
assert:aBoolean description:aString resumable:resumableBoolean 
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   404
    <resource: #skipInDebuggersWalkBack>
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   405
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   406
    aBoolean ifFalse:[
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   407
        self logFailure:aString.
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   408
        self signalFailure:aString resumable:resumableBoolean
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   409
    ]
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   410
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   411
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   412
assert: aBoolean message:messageIfFailing
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   413
    "fail, if the argument is not true"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   414
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   415
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   416
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   417
    "check the testCase itself"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   418
    (aBoolean isBoolean) ifFalse:[ self error:'non boolean assertion' ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   419
    aBoolean ifFalse: [self signalFailure: messageIfFailing resumable:true]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   420
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   421
    "Modified: / 21-06-2000 / 10:00:05 / Sames"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   422
    "Modified: / 06-08-2006 / 22:56:21 / cg"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   423
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   424
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   425
assertFalse:aBoolean
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   426
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   427
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   428
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   429
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   430
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   431
assertFalse:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   432
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   433
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   434
    ^ self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   435
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   436
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   437
assertTrue:aBoolean 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   438
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   439
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   440
    ^ self assert:aBoolean
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   441
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   442
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   443
assertTrue:aBoolean named:testName
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   444
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   445
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   446
    ^ self assert:aBoolean
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   447
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   448
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   449
deny:aBoolean 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   450
    "fail, if the argument is not false"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   451
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   452
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   453
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   454
    self assert:aBoolean not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   455
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   456
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   457
deny: aBoolean description: aString
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   458
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   459
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   460
    self assert: aBoolean not description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   461
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   462
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   463
deny: aBoolean description: aString resumable: resumableBoolean 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   464
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   465
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   466
    self
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   467
            assert: aBoolean not
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   468
            description: aString
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   469
            resumable: resumableBoolean
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   470
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   471
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   472
should:aBlock 
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   473
    "fail, if the block does not evaluate to true"
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   474
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   475
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   476
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   477
    self assert:aBlock value
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   478
!
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   479
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   480
should: aBlock description: aString
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   481
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   482
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   483
    self assert: aBlock value description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   484
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   485
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   486
should:aBlock raise:anExceptionalEvent 
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   487
    "fail, if the block does not raise the given event"
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   488
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   489
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   490
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   491
    ^ self assert:(self executeShould:aBlock inScopeOf:anExceptionalEvent)
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   492
!
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   493
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   494
should: aBlock raise: anExceptionalEvent description: aString 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   495
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   496
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   497
    ^self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent)
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   498
            description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   499
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   500
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   501
shouldnt:aBlock 
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   502
    "fail, if the block does evaluate to true"
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   503
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   504
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   505
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   506
    self deny:aBlock value
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   507
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   508
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   509
shouldnt: aBlock description: aString
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   510
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   511
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   512
    self deny: aBlock value description: aString
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   513
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   514
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   515
shouldnt:aBlock raise:anExceptionalEvent 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   516
    "fail, if the block does raise the given event"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   517
    
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   518
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   519
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   520
    ^ self 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   521
        assert:(self executeShould:aBlock inScopeOf:anExceptionalEvent) not
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   522
!
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
shouldnt: aBlock raise: anExceptionalEvent description: aString 
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   525
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   526
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   527
    ^self assert: (self executeShould: aBlock inScopeOf: anExceptionalEvent) not            description: aString
66
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   528
! !
31ae5b8fc382 category rename
Claus Gittinger <cg@exept.de>
parents: 65
diff changeset
   529
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   530
!TestCase methodsFor:'dependencies'!
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
addDependentToHierachy: anObject 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   533
	"an empty method. for Composite compability with TestSuite"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   534
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   535
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   536
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   537
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   538
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   539
removeDependentFromHierachy: anObject 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   540
	"an empty method. for Composite compability with TestSuite"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   541
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
! !
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   545
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   546
!TestCase methodsFor:'printing'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   547
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   548
name
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   549
        ^ self class name.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   550
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   551
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   552
printOn: aStream
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   553
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   554
"/        aStream
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   555
"/                nextPutAll: self class printString;
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   556
"/                nextPutAll: '>>#';
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   557
"/                nextPutAll: testSelector
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   558
                        
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   559
        aStream nextPutAll: self name.
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   560
        aStream nextPutAll: '>>'.
118
9464f408680f care for printing uninitialized testcases
Claus Gittinger <cg@exept.de>
parents: 103
diff changeset
   561
        testSelector printOn: aStream
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   562
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   563
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   564
testName
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   565
        ^ testSelector.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   566
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   567
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   568
!TestCase methodsFor:'private'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   569
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   570
executeShould: aBlock inScopeOf: anExceptionalEvent 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   571
"/        ^[aBlock value.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   572
"/        false] sunitOn: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   573
"/                do: [:ex | ex sunitExitWith: true]
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   574
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   575
"/        [[aBlock value]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   576
"/                on: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   577
"/                do: [:ex | ^true]]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   578
"/                        on: TestResult exError
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   579
"/                        do: [:ex | ^false].
209
cec4475f7138 changed: #executeShould:inScopeOf:
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   580
        aBlock
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   581
                on: anExceptionalEvent
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   582
                do: [:ex | ^true].
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   583
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   584
        ^false.
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   585
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   586
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   587
performTest
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   588
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   589
        self perform: testSelector asSymbol
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   590
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   591
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   592
setTestSelector: aSymbol
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   593
	testSelector := aSymbol
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
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   597
signalFailure: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   598
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   599
"/        TestResult failure sunitSignalWith: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   600
    TestResult failure raiseErrorString:aString in:thisContext sender sender .
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   601
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   602
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   603
signalFailure:aString resumable:isResumable 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   604
    "/        TestResult failure sunitSignalWith: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   605
179
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   606
    <resource: #skipInDebuggersWalkBack>
caba0f640d13 context skipping in debugger generalized
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   607
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   608
    isResumable ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   609
        TestResult resumableFailure 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   610
            raiseRequestWith:nil
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   611
            errorString:aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   612
            in:thisContext sender sender
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   613
    ] ifFalse:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   614
        TestResult failure 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   615
            raiseErrorString:aString 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   616
            in:thisContext sender sender
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   617
    ].
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   618
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   619
    "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
   620
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   621
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   622
signalUnavailableResources
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 resources do:[:res | 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   625
        res isAvailable ifFalse:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   626
            ^ res signalInitializationError
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   627
        ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   628
    ].
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   629
! !
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   630
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   631
!TestCase methodsFor:'queries'!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   632
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   633
isTestCase
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   634
    ^ true
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   635
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   636
221
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   637
isTestCaseLike
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   638
    ^ true
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   639
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   640
    "Created: / 29-06-2011 / 20:37:57 / cg"
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   641
!
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   642
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   643
isTestSuite
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   644
    ^ false
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   645
! !
122
61e456491017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   646
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   647
!TestCase methodsFor:'running'!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   648
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   649
debug
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   650
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   651
"/        self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   652
"/        [(self class selector: testSelector) runCase] 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   653
"/                sunitEnsure: [self resources do: [:each | each reset]]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   654
        self debugUsing:#runCase.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   655
!
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   656
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   657
debugAsFailure
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   658
    |semaphore|
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   659
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   660
    self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   661
    semaphore := Semaphore new.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   662
    [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   663
        semaphore wait.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   664
        self resources do:[:each | 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   665
            each reset
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   666
        ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   667
    ] fork.
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   668
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   669
    "/ used to be: 
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   670
    "/  (self class selector:testSelector) runCaseAsFailure:semaphore
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   671
    "/ which is bad for subclasses which need more arguments.
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   672
    "/ why not use:
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   673
    "/  self copy perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   674
    "/ or even
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   675
    "/  self perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   676
    "/ (self class selector:testSelector) runCaseAsFailure:semaphore.
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   677
    self runCaseAsFailure:semaphore
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   678
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   679
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   680
debugUsing:aSymbol 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   681
    self signalUnavailableResources.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   682
    [
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   683
        "/ used to be: 
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   684
        "/  (self class selector:testSelector) perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   685
        "/ which is bad for subclasses which need more arguments.
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   686
        "/ why not use:
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   687
        "/  self copy perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   688
        "/ or even
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   689
        "/  self perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   690
        "/ (self class selector:testSelector) perform:aSymbol
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   691
        self perform:aSymbol
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   692
    ] ensure:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   693
        self resources do:[:each | 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   694
            each reset
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   695
        ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   696
    ]
194
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   697
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   698
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   699
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   700
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   701
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   702
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   703
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   704
bbb55d499a1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 181
diff changeset
   705
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   706
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   707
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   708
failureLog      
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   709
        ^SUnitNameResolver class >> #defaultLogDevice
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   710
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   711
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   712
isLogging
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   713
	"By default, we're not logging failures. If you override this in 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   714
	a subclass, make sure that you override #failureLog"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   715
	^false
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   716
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   717
!
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   718
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   719
logFailure: aString
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   720
	self isLogging ifTrue: [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   721
		self failureLog 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   722
			cr; 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   723
			nextPutAll: aString; 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   724
			flush]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   725
			
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   726
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   727
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   728
openDebuggerOnFailingTestMethod
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   729
        "SUnit has halted one step in front of the failing test method. Step over the 'self halt' and 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   730
         send into 'self perform: testSelector' to see the failure from the beginning"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   731
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   732
        self
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   733
                "halt;"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   734
                performTest
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   735
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   736
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   737
run
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   738
	| result |
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   739
	result := TestResult new.
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   740
	self run: result.
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   741
	^result
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   742
			
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   743
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   744
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   745
run: aResult
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   746
	aResult runCase: self
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   747
			
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   748
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   749
139
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   750
run: aResult afterEachDo:block2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   751
        aResult runCase: self.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   752
        block2 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   753
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   754
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   755
run: aResult beforeEachDo:block1 afterEachDo:block2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   756
        block1 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   757
        aResult runCase: self.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   758
        block2 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   759
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   760
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   761
run: aResult beforeEachTestCaseDo:block1 afterEachTestCaseDo:block2
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   762
        block1 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   763
        aResult runCase: self.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   764
        block2 value:self value:aResult.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   765
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   766
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   767
runCase
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   768
    [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   769
        self setUp.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   770
        self performTest
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   771
    ] ensure:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   772
        Error ,  AbortOperationRequest
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   773
            handle:[:ex |
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   774
                ex signal ~~ AbortOperationRequest ifTrue:[
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   775
                    Transcript showCR:'Error during tearDown: "', ex description, '" - ignored'. 
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   776
                ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   777
            ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   778
            do:[ self tearDown ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   779
    ]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   780
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   781
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   782
runCaseAsFailure
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   783
        self setUp.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   784
        [[self openDebuggerOnFailingTestMethod] ensure: [self tearDown]] fork
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   785
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   786
    "Modified: / 21.6.2000 / 10:04:33 / Sames"
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   787
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   788
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   789
runCaseAsFailure: aSemaphore
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   790
        [self setUp.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   791
        self openDebuggerOnFailingTestMethod] ensure: [
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   792
                self tearDown.
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   793
                aSemaphore signal]
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   794
!
5a48f282d789 back to 1.42 - last checked in version was bogus
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   795
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   796
setUp
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   797
			
67
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   798
!
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   799
7861684195ec category rename
Claus Gittinger <cg@exept.de>
parents: 66
diff changeset
   800
tearDown
103
ad6897ce99e0 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   801
			
50
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
   802
! !
6db52a1a4543 updgraded to 3.0
Claus Gittinger <cg@exept.de>
parents: 40
diff changeset
   803
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   804
!TestCase class methodsFor:'documentation'!
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   805
203
ca0c9f44ee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
   806
version_CVS
221
914934672e32 added: #isTestCaseLike
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
   807
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.57 2011-06-29 18:38:32 cg Exp $'
12
4a6597527f92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   808
! !
81
10852410025d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   809
2
6f450bf08bc0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1
diff changeset
   810
TestCase initialize!