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