TestResult.st
author Claus Gittinger <cg@exept.de>
Thu, 08 Nov 2012 01:04:57 +0100
changeset 525 a0d7db6472af
parent 506 11714170ac0e
child 532 fa66c637614e
permissions -rw-r--r--
lastState fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/sunit' }"
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:#TestResult
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
     4
	instanceVariableNames:'name timestamp failures errors passed skipped outcome'
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
     5
	classVariableNames:'DefaultClass'
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
     6
	poolDictionaries:''
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
     7
	category:'SUnit-Base'
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
     8
!
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
     9
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    10
TestResult comment:''
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
336
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    13
!TestResult class methodsFor:'documentation'!
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    14
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    15
documentation
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    16
"
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    17
    runInfoPerTest:
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    18
        will keep additional info for a testCase run:
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    19
            startTime, endTime, backtrace (if fail or error) and collectedStdout
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    20
"
f0a47040f7b4 preparations for cleanup
Claus Gittinger <cg@exept.de>
parents: 325
diff changeset
    21
! !
14
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
    22
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    23
!TestResult class methodsFor:'instance creation'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    24
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    25
new
462
4014869e047c changed: #new
Claus Gittinger <cg@exept.de>
parents: 447
diff changeset
    26
    self sunitName == #TestResult ifTrue:[
405
vrany
parents: 347
diff changeset
    27
        ^ self defaultResultClass basicNew initialize.
vrany
parents: 347
diff changeset
    28
    ] ifFalse:[
vrany
parents: 347
diff changeset
    29
        ^ self basicNew initialize
vrany
parents: 347
diff changeset
    30
    ].
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    31
405
vrany
parents: 347
diff changeset
    32
    "
vrany
parents: 347
diff changeset
    33
        TestResult new.
vrany
parents: 347
diff changeset
    34
        TestResultForRunWithDebug new.
vrany
parents: 347
diff changeset
    35
    "
vrany
parents: 347
diff changeset
    36
vrany
parents: 347
diff changeset
    37
    "Modified (comment): / 20-08-2011 / 17:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    38
! !
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    39
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    40
!TestResult class methodsFor:'accessing'!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    41
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    42
defaultResultClass
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    43
    DefaultClass notNil ifTrue:[^DefaultClass].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    44
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    45
    ((Smalltalk respondsTo: #isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifTrue:[
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    46
        DefaultClass := TestResultStX.
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    47
        ^DefaultClass
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    48
    ].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    49
    "Add more dialects here, if you want..."
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    50
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    51
    "Default"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    52
    DefaultClass := self.
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    53
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
    54
    "Created: / 16-08-2011 / 15:02:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    55
! !
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    56
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    57
!TestResult class methodsFor:'constants'!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    58
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    59
stateError
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    60
    ^ #error
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    61
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    62
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    63
stateFail
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    64
    "this symbl used to freak around everywhere in the code;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    65
     and I was never sure if #fail or #failed is to be used."
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    66
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    67
    ^ #fail
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    68
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    69
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    70
statePass
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    71
    "this symbl used to freak around everywhere in the code;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    72
     and I was never sure if #pass or #passed is to be used."
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    73
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    74
    ^ #pass
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    75
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    76
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    77
stateSkip
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    78
    ^ #skip
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    79
! !
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
    80
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 53
diff changeset
    81
!TestResult class methodsFor:'exceptions'!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
error
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    84
	^self exError
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
exError
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    88
	^SUnitNameResolver errorObject
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
failure
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    92
	^TestFailure
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    93
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    95
resumableFailure
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
    96
	^ResumableTestFailure
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
    99
signalErrorWith: aString
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   100
	self error sunitSignalWith: aString
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   101
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   103
signalFailureWith: aString
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   104
	self failure sunitSignalWith: aString
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
501
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   107
!TestResult class methodsFor:'utilities'!
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   108
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   109
sourceFilenameOfClass:aClass
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   110
    ^ nil
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   111
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   112
    " use something like... "
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   113
    " ^ aClass classFilename asFilename pathName. "
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   114
! !
6ffd3fa997b2 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
   115
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 53
diff changeset
   116
!TestResult methodsFor:'accessing'!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
defects
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   119
	^OrderedCollection new
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   120
		addAll: self errors;
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   121
		addAll: self failures; yourself
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
478
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   124
endTime:aTimestamp
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   125
    "sets the overall (suite) end time"
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   126
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   127
    "/ ignored, for now (Neil should add it)
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   128
    "/ endTime := aTimestamp.
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   129
!
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   130
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
errorCount
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   132
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   133
        ^self errorOutcomes size
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   134
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   135
    "Modified: / 16-08-2011 / 15:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   136
!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   137
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   138
errorOutcomes
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   139
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   140
    errors isNil ifTrue: [errors := OrderedCollection new].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   141
    ^errors
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   142
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   143
    "Created: / 16-08-2011 / 15:55:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   144
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
errors
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   147
447
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   148
    errors isNil ifTrue: [^OrderedCollection new].
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   149
    ^errors collect:[:each|each testCase]
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   150
447
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   151
    "Modified (format): / 02-08-2012 / 15:40:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   152
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   154
exceptions
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   155
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   156
    "Returns a set of exceptions to be handled. Bu default,
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   157
     failure and generic error is handled. This method may
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   158
     be overriden by custom TestResult subclasses to add more.
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   159
     For example, a 'self halt' is not handled by default
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   160
     exceptions set"
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   161
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   162
    ^self class failure , self class error
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   163
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   164
    "Created: / 03-08-2011 / 14:11:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   165
!
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   166
481
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   167
executionTime
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   168
    "return the execution time (in seconds). 
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   169
     If unknown, or asked before or during a run, return nil"
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   170
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   171
    ^ nil
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   172
!
5fc3207c141a added: #executionTime
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   173
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
failureCount
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   176
        ^self failureOutcomes size
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   177
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   178
    "Modified: / 16-08-2011 / 15:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   179
!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   180
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   181
failureOutcomes
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   182
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   183
    failures isNil ifTrue: [failures := Set new].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   184
    ^failures
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   185
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   186
    "Created: / 16-08-2011 / 15:56:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
!
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
failures
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   190
    "We use a Set, not an OrderedCollection as #errors and #passed do, 
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   191
     because a resumable test failure in a loop can raise many failures against the same test.  
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   192
     In current Sunit UIs, this could result in bizarre test count reporting (-27 tests run, and suchlike).  
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   193
     This will be reviewed."
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   194
447
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   195
    failures isNil ifTrue: [^OrderedCollection new].
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   196
    ^failures collect:[:each|each testCase]
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   197
447
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   198
    "Modified (format): / 02-08-2012 / 14:55:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   199
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   200
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   201
name
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   202
    ^ name
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   203
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   204
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   205
name:aString
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   206
    name := aString.
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   207
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   209
outcomes
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   210
    |all|
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   211
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   212
    all := OrderedCollection new.
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   213
    self outcomesDo:[:each | all add:each].
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   214
    ^ all.
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   215
!
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   216
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   217
outcomesDo: aBlock
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   218
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   219
    skipped notNil ifTrue:[skipped do: aBlock].
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   220
    failures notNil ifTrue:[failures do: aBlock].
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   221
    errors notNil ifTrue:[errors do: aBlock].
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   222
    passed notNil ifTrue:[passed do: aBlock].
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   223
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   224
    "Created: / 20-08-2011 / 14:01:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   225
!
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   226
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   227
passed
434
14f83a6de60e changed: #passed
Claus Gittinger <cg@exept.de>
parents: 431
diff changeset
   228
        passed isNil ifTrue: [
14f83a6de60e changed: #passed
Claus Gittinger <cg@exept.de>
parents: 431
diff changeset
   229
            "/ cg: exposed and added to (see TestRunnerEmbedded>>debug)
14f83a6de60e changed: #passed
Claus Gittinger <cg@exept.de>
parents: 431
diff changeset
   230
            passed := OrderedCollection new.
14f83a6de60e changed: #passed
Claus Gittinger <cg@exept.de>
parents: 431
diff changeset
   231
            ^ passed.
14f83a6de60e changed: #passed
Claus Gittinger <cg@exept.de>
parents: 431
diff changeset
   232
        ].
447
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   233
        ^passed collect:[:each|each testCase]
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   234
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   235
    "Modified: / 16-08-2011 / 15:54:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
434
14f83a6de60e changed: #passed
Claus Gittinger <cg@exept.de>
parents: 431
diff changeset
   236
    "Modified: / 07-11-2011 / 11:19:57 / cg"
447
7cc5530a8842 comment/format in: #runCase:debugged:
vrany
parents: 446
diff changeset
   237
    "Modified (format): / 02-08-2012 / 14:55:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   238
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   239
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   240
passedCount
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   241
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   242
        ^self passedOutcomes size
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   243
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   244
    "Modified: / 16-08-2011 / 15:58:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   245
!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   246
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   247
passedOutcomes
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   248
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   249
    passed isNil ifTrue: [passed := OrderedCollection new].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   250
    ^passed
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   251
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   252
    "Created: / 16-08-2011 / 15:56:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   253
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   254
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
runCount
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   256
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   257
	^self passedCount + self failureCount + self errorCount
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   258
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   259
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   260
skipped
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   261
        skipped isNil ifTrue: [
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   262
            "/ cg: exposed and added to (see TestRunnerEmbedded>>debug)
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   263
            skipped := OrderedCollection new.
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   264
            ^ skipped.
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   265
        ].
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   266
        ^skipped collect:[:each|each testCase]
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   267
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   268
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   269
skippedCount
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   270
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   271
        ^self skippedOutcomes size
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   272
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   273
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   274
skippedOutcomes
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   275
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   276
    skipped isNil ifTrue: [skipped := OrderedCollection new].
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   277
    ^skipped
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   278
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   279
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   280
testOutcomes
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   281
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   282
        ^(OrderedCollection new: self runCount)
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   283
                addAll: self passedOutcomes;
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   284
                addAll: self skippedOutcomes;
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   285
                addAll: self errorOutcomes;
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   286
                addAll: self failureOutcomes;
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   287
                yourself
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   288
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   289
    "Created: / 16-08-2011 / 16:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   290
!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   291
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   292
tests
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   293
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   294
        ^(OrderedCollection new: self runCount)
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   295
                addAll: self passed;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   296
                addAll: self skipped;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   297
                addAll: self errors;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   298
                addAll: self failures;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   299
                yourself
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   300
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   301
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   302
timestamp
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   303
    ^ timestamp
270
edb137bd861e added: #timestamp:
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   304
!
edb137bd861e added: #timestamp:
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   305
478
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   306
timestamp:aTimestamp
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   307
    timestamp := aTimestamp.
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   308
! !
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   310
!TestResult methodsFor:'adding / removing'!
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   311
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   312
addError:testcase detail:detail 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   313
    "Called when a test outcome is error. testCase 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   314
     is the errorneous testcase, detail is platform
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   315
     specific object describing the error. Actually,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   316
     on all platforms exept GemStone, detail is an instance
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   317
     of an exception that caused the error"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   318
    "JV2011-08-03: TODO: Validate the comment above with GS,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   319
     possibly change name to 'exception'"
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   320
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   321
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   322
    outcome result: (TestResult stateError).
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   323
    outcome remember.
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   324
    ^ self errorOutcomes add:outcome.
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   325
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   326
    "Created: / 03-08-2011 / 13:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
318
96ce5904bba6 added: #rememberException:detail:
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   327
    "Modified: / 06-08-2011 / 09:46:41 / cg"
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   328
    "Modified: / 20-08-2011 / 12:46:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   329
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   330
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   331
addFailure:testcase detail:detail 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   332
    "Called when a test fails. testCase is the failed 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   333
     testcase, detail is platform specific object describing
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   334
     the failure. Actually, on all platforms exept GemStone,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   335
     detail is an instance of an exception that caused the failure"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   336
    "JV2011-08-03: TODO: Validate the comment above with GS,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   337
     possibly change name to 'exception'"
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   338
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   339
     "Special handling here, because failures can be resumable"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   340
    self failureOutcomes do:[:outcome | 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   341
        outcome testCase = testcase ifTrue:[
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   342
            ^ self
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   343
        ].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   344
    ].
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   345
    outcome result: (TestResult stateFail).
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   346
    outcome remember.
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   347
    ^ self failureOutcomes add: outcome
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   348
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   349
    "Created: / 03-08-2011 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
318
96ce5904bba6 added: #rememberException:detail:
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   350
    "Modified: / 06-08-2011 / 09:55:17 / cg"
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   351
    "Modified: / 20-08-2011 / 12:46:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
318
96ce5904bba6 added: #rememberException:detail:
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   352
!
96ce5904bba6 added: #rememberException:detail:
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   353
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   354
addPass:testCase 
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   355
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   356
    outcome result: (TestResult statePass).
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   357
    outcome remember.
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   358
    ^ self passedOutcomes add: outcome
325
76240d956e7d changed: #rememberExceptionIn:detail:
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   359
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   360
    "Modified: / 20-08-2011 / 12:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   361
!
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   362
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   363
addSkipped:testCase 
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   364
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   365
    outcome result: (TestResult stateSkip).
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   366
    outcome remember.
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   367
    ^ self skippedOutcomes add: outcome
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   368
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   369
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   370
remove: aTestCase
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   371
    "Removes an outcome for given testcase, if any.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   372
    Use with care."
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   373
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   374
    | remover |
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   375
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   376
    remover := [:outcomes|
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   377
        | o |
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   378
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   379
        outcomes notNil ifTrue:[
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   380
            o := outcomes detect:[:each|each testCase == aTestCase] ifNone: [nil].
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   381
            o notNil ifTrue:[outcomes remove: o. ^self].
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   382
        ].
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   383
    ].
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   384
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   385
    remover value: skipped.
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   386
    remover value: errors.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   387
    remover value: failures.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   388
    remover value: passed.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   389
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   390
    "Created: / 16-01-2012 / 20:36:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   391
! !
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   392
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   393
!TestResult methodsFor:'deprecated'!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   394
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   395
correctCount
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   396
	"deprecated - use #passedCount"
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   397
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   398
	^self passedCount
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   399
! !
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   400
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   401
!TestResult methodsFor:'initialize-release'!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
initialize
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   404
! !
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   406
!TestResult methodsFor:'outcome'!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   407
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   408
createOutcome
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   409
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   410
    ^TestCaseOutcome new.
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   412
    "Created: / 16-08-2011 / 17:14:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   413
!
297
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   414
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   415
rememberEndTime
478
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   416
    "remembers the endTime of the current test (in outcome)"
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   417
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   418
    ^nil
292
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   419
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   420
    "Created: / 16-08-2011 / 17:31:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   421
!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   422
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   423
rememberException:detail
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   424
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   425
    "Created: / 16-08-2011 / 17:35:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   426
!
292
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   427
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   428
rememberStartTime
478
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   429
    "remembers the startTime of the current test (in outcome)"
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   430
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   431
    ^nil
292
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   432
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   433
    "Created: / 16-08-2011 / 17:31:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   434
! !
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   435
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   436
!TestResult methodsFor:'printing'!
292
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   437
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
printOn: aStream
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   439
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   440
        aStream
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   441
                nextPutAll: self runCount printString;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   442
                nextPutAll: ' run, ';
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   443
                nextPutAll: self passedCount printString;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   444
                nextPutAll: ' passed, ';
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   445
                nextPutAll: self skippedCount printString;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   446
                nextPutAll: ' skipped, ';
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   447
                nextPutAll: self failureCount printString;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   448
                nextPutAll: ' failed, ';
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   449
                nextPutAll: self errorCount printString;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   450
                nextPutAll: ' error'.
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   451
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   452
        self errorCount ~= 1
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   453
                ifTrue: [aStream nextPut: $s]
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 53
diff changeset
   456
!TestResult methodsFor:'running'!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
303
6d21e7a22412 - doRunCase: renamed to performCase:
vrany
parents: 300
diff changeset
   458
performCase:aTestCase 
6d21e7a22412 - doRunCase: renamed to performCase:
vrany
parents: 300
diff changeset
   459
    "Actually performs the case. The TestCase>>runCase itself calls
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   460
     a setUp/tearDown methods. The possible error/failure is handled
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   461
     in TestResult>>runCase:. This method is meant to be overriden by
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   462
     custom TestResult subclasses."
303
6d21e7a22412 - doRunCase: renamed to performCase:
vrany
parents: 300
diff changeset
   463
    
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   464
    aTestCase runCase.
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   465
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   466
    "Modified: / 02-08-2011 / 18:10:09 / cg"
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   467
    "Created: / 03-08-2011 / 14:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   468
!
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   469
303
6d21e7a22412 - doRunCase: renamed to performCase:
vrany
parents: 300
diff changeset
   470
runCase:aTestCase 
316
d01820e6d817 changed:
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   471
    "run a testcase, catching exceptions"
d01820e6d817 changed:
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   472
429
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   473
    self runCase:aTestCase debugged:false
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   474
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   475
    "Modified: / 16-08-2011 / 17:35:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   476
    "Modified: / 21-08-2011 / 17:48:28 / cg"
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   477
!
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   478
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   479
runCase:aTestCase debugged:debugged
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   480
    "run a testcase, debugging exceptions"
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   481
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   482
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   483
    [
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   484
        [ 
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   485
            outcome := self createOutcome.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   486
            outcome testCase: aTestCase.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   487
            self rememberStartTime.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   488
            self performCase:aTestCase.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   489
            self rememberEndTime.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   490
            self addPass:aTestCase.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   491
            outcome := nil.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   492
        ] sunitOn:self exceptions do: [:ex |
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   493
            self rememberEndTime.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   494
            self rememberException: ex.
444
c1f0f17a9e21 changed: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 438
diff changeset
   495
            (AbortSignal accepts: ex signal) ifTrue:[ex reject].
446
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   496
            (TerminateProcessRequest accepts: ex signal) ifTrue:[ex reject].
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   497
            ex sunitAnnounce:aTestCase toResult:self.
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   498
            self halt.    
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   499
        ].
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   500
    ] sunitOn: self exceptions do:[:ex|
444
c1f0f17a9e21 changed: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 438
diff changeset
   501
        (AbortSignal accepts: ex signal) ifTrue:[ex reject].
446
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   502
        (TerminateProcessRequest accepts: ex signal) ifTrue:[ex reject].
506
11714170ac0e class: TestResult
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   503
"/ the stuff below is rubbish - it clears out the info as collected above!!
11714170ac0e class: TestResult
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   504
"/        self remove: aTestCase.
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   505
self halt.
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   506
        debugged ifTrue:[ ex reject ].
506
11714170ac0e class: TestResult
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   507
"/        ex sunitAnnounce:aTestCase toResult:self.
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   508
    ]
292
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   509
429
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   510
    "Created: / 21-08-2011 / 17:48:19 / cg"
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   511
    "Modified: / 16-01-2012 / 20:37:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
446
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   512
    "Modified: / 04-06-2012 / 18:50:15 / cg"
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 53
diff changeset
   515
!TestResult methodsFor:'testing'!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   517
hasErrors
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   518
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   519
	^self errors size > 0
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   520
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   521
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   522
hasFailures
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   523
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   524
	^self failures size > 0
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   525
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   526
446
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   527
hasFailuresOrErrors
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   528
    ^ self hasFailures or:[self hasErrors]
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   529
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   530
    "Created: / 04-06-2012 / 19:06:52 / cg"
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   531
!
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   532
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
hasPassed
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   534
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   535
	^self hasErrors not and: [self hasFailures not]
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   536
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   537
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   538
isError: aTestCase
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   539
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   540
	^self errors includes: aTestCase
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   541
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
isFailure: aTestCase
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   544
	^self failures includes: aTestCase
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   545
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   546
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   547
isPassed: aTestCase
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   548
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   549
	^self passed includes: aTestCase
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   550
! !
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
14
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   552
!TestResult class methodsFor:'documentation'!
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   553
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   554
version
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   555
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestResult.st,v 1.50 2012-11-08 00:04:57 cg Exp $'
297
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   556
!
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   557
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   558
version_CVS
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   559
    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestResult.st,v 1.50 2012-11-08 00:04:57 cg Exp $'
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   560
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   561
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   562
version_SVN
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   563
    ^ '§Id: TestResult.st 205 2010-09-11 15:23:01Z vranyj1 §'
14
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   564
! !