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