TestResult.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 07 Oct 2022 12:27:15 +0100
branchjv
changeset 773 5e936bce7857
parent 673 7c5c1bc3be7b
permissions -rw-r--r--
Increase interation times when running under Jenkins ...to ridiculously high values. This is an attempt to stabilize builds as they often spuriously fail because of UI tests. Sigh.
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
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 644
diff changeset
   263
        ^self passedCount + self failureCount + self errorCount + self skippedCount
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 644
diff changeset
   264
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 644
diff changeset
   265
    "Modified: / 03-09-2016 / 09:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   266
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   267
487
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
        skipped isNil ifTrue: [
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   270
            "/ cg: exposed and added to (see TestRunnerEmbedded>>debug)
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   271
            skipped := OrderedCollection new.
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   272
            ^ skipped.
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
        ^skipped collect:[:each|each testCase]
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   275
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   276
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   277
skippedCount
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
        ^self skippedOutcomes size
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   280
!
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
skippedOutcomes
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   283
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   284
    skipped isNil ifTrue: [skipped := OrderedCollection new].
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   285
    ^skipped
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   286
!
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   287
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   288
testOutcomes
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   289
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   290
        ^(OrderedCollection new: self runCount)
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   291
                addAll: self passedOutcomes;
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   292
                addAll: self skippedOutcomes;
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   293
                addAll: self errorOutcomes;
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   294
                addAll: self failureOutcomes;
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   295
                yourself
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   296
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   297
    "Created: / 16-08-2011 / 16:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   298
!
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   299
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   300
tests
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   301
487
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   302
        ^(OrderedCollection new: self runCount)
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   303
                addAll: self passed;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   304
                addAll: self skipped;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   305
                addAll: self errors;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   306
                addAll: self failures;
52803f8a7029 preparations for skipping tests;
Claus Gittinger <cg@exept.de>
parents: 481
diff changeset
   307
                yourself
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   308
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   309
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   310
timestamp
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   311
    ^ timestamp
270
edb137bd861e added: #timestamp:
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   312
!
edb137bd861e added: #timestamp:
Claus Gittinger <cg@exept.de>
parents: 242
diff changeset
   313
478
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   314
timestamp:aTimestamp
a8ca323da616 comments
Claus Gittinger <cg@exept.de>
parents: 462
diff changeset
   315
    timestamp := aTimestamp.
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   316
! !
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   318
!TestResult methodsFor:'adding / removing'!
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   319
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   320
addError:testcase detail:detail 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   321
    "Called when a test outcome is error. testCase 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   322
     is the errorneous testcase, detail is platform
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   323
     specific object describing the error. Actually,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   324
     on all platforms exept GemStone, detail is an instance
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   325
     of an exception that caused the error"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   326
    "JV2011-08-03: TODO: Validate the comment above with GS,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   327
     possibly change name to 'exception'"
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   328
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   329
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   330
    outcome result: (TestResult stateError).
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   331
    outcome remember.
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   332
    ^ self errorOutcomes add:outcome.
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   333
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   334
    "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
   335
    "Modified: / 06-08-2011 / 09:46:41 / cg"
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   336
    "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
   337
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   338
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   339
addFailure:testcase detail:detail 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   340
    "Called when a test fails. testCase is the failed 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   341
     testcase, detail is platform specific object describing
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   342
     the failure. Actually, on all platforms exept GemStone,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   343
     detail is an instance of an exception that caused the failure"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   344
    "JV2011-08-03: TODO: Validate the comment above with GS,
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   345
     possibly change name to 'exception'"
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   346
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   347
     "Special handling here, because failures can be resumable"
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   348
    self failureOutcomes do:[:outcome | 
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   349
        outcome testCase = testcase ifTrue:[
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   350
            ^ self
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   351
        ].
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   352
    ].
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   353
    outcome result: (TestResult stateFail).
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   354
    outcome remember.
347
1f72b6bb67a4 Refactored to use TestResultOutcome
vrany
parents: 336
diff changeset
   355
    ^ self failureOutcomes add: outcome
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   356
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   357
    "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
   358
    "Modified: / 06-08-2011 / 09:55:17 / cg"
418
bc5e6e66a5ee Lost methods
vrany
parents: 405
diff changeset
   359
    "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
   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
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 644
diff changeset
   472
    aTestCase runCase.
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   473
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   474
    "Modified: / 02-08-2011 / 18:10:09 / cg"
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   475
    "Created: / 03-08-2011 / 14:02:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 644
diff changeset
   476
    "Modified (comment): / 03-09-2016 / 09:02:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
300
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   477
!
570aed392231 TestResult refactoring - now it allow for more fine-grained customization
vrany
parents: 297
diff changeset
   478
303
6d21e7a22412 - doRunCase: renamed to performCase:
vrany
parents: 300
diff changeset
   479
runCase:aTestCase 
316
d01820e6d817 changed:
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   480
    "run a testcase, catching exceptions"
d01820e6d817 changed:
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   481
429
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   482
    self runCase:aTestCase debugged:false
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   483
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   484
    "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
   485
    "Modified: / 21-08-2011 / 17:48:28 / cg"
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   486
!
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   487
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   488
runCase:aTestCase debugged:debugged
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   489
    "run a testcase, debugging exceptions"
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   490
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   491
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   492
    [
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   493
        [ 
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   494
            outcome := self createOutcome.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   495
            outcome testCase: aTestCase.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   496
            self rememberStartTime.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   497
            self performCase:aTestCase.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   498
            self rememberEndTime.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   499
            self addPass:aTestCase.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   500
            outcome := nil.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   501
        ] sunitOn:self exceptions do: [:ex |
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   502
            self rememberEndTime.
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   503
            self rememberException: ex.
572
7a3643c916c2 use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
   504
            (AbortSignal accepts: ex creator) ifTrue:[ex reject].
7a3643c916c2 use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
   505
            (TerminateProcessRequest accepts: ex creator) ifTrue:[ex reject].
603
ccbf7219ef3d class: TestResult
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   506
            debugged ifFalse:[
ccbf7219ef3d class: TestResult
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   507
                ex sunitAnnounce:aTestCase toResult:self.
ccbf7219ef3d class: TestResult
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   508
                "/ not reached, because sunitAnnouce returns from ex!!
ccbf7219ef3d class: TestResult
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   509
            ].
644
b4b9fdee25b1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   510
            (TestSkipped accepts: ex creator) ifFalse:[
b4b9fdee25b1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   511
                self addFailure: aTestCase detail: ex.
b4b9fdee25b1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   512
            ].    
603
ccbf7219ef3d class: TestResult
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   513
            self breakPoint:#cg.
ccbf7219ef3d class: TestResult
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
   514
            ex reject.
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   515
        ].
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   516
    ] sunitOn: self exceptions do:[:ex|
644
b4b9fdee25b1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 643
diff changeset
   517
        (TestSkipped accepts: ex creator) ifTrue:[ex return].
572
7a3643c916c2 use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
   518
        (AbortSignal accepts: ex creator) ifTrue:[ex reject].
7a3643c916c2 use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
   519
        (TerminateProcessRequest accepts: ex creator) ifTrue:[ex reject].
596
75398d76ec7c class: TestResult
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   520
        "/ 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
   521
        "/ self remove: aTestCase.
525
a0d7db6472af lastState fixes
Claus Gittinger <cg@exept.de>
parents: 506
diff changeset
   522
        debugged ifTrue:[ ex reject ].
438
ceb3517dcae7 - Handler for possible error in #tearDown
vrany
parents: 434
diff changeset
   523
    ]
292
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   524
429
35fec79a1ffe added: #runCase:debugged:
Claus Gittinger <cg@exept.de>
parents: 418
diff changeset
   525
    "Created: / 21-08-2011 / 17:48:19 / cg"
446
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   526
    "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
   527
    "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
   528
! !
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 53
diff changeset
   530
!TestResult methodsFor:'testing'!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   532
hasErrors
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   533
671
22e65332137a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   534
        ^self errors notEmptyOrNil
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   535
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   536
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   537
hasFailures
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 failures 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
446
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   542
hasFailuresOrErrors
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   543
    ^ self hasFailures or:[self hasErrors]
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   544
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   545
    "Created: / 04-06-2012 / 19:06:52 / cg"
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   546
!
4d4b49d09e2f added: #hasFailuresOrErrors
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   547
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
hasPassed
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   549
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   550
	^self hasErrors not and: [self hasFailures not]
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   551
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   552
671
22e65332137a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   553
hasSkipped
22e65332137a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   554
22e65332137a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   555
        ^self skipped notEmptyOrNil
22e65332137a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   556
!
22e65332137a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   557
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   558
isError: aTestCase
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   559
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   560
	^self errors includes: aTestCase
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   561
!
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
isFailure: aTestCase
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   564
	^self failures includes: aTestCase
53
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   565
!
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   566
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   567
isPassed: aTestCase
51abd9fe4db2 switch to rel3.0
Claus Gittinger <cg@exept.de>
parents: 47
diff changeset
   568
104
974f57e122c1 Merge SUnit 3.1 changes
Stefan Vogel <sv@exept.de>
parents: 101
diff changeset
   569
	^self passed includes: aTestCase
6
78bb1397e43d added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents: 0
diff changeset
   570
! !
0
9365d5753f11 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
14
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   572
!TestResult class methodsFor:'documentation'!
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   573
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   574
version
629
05b7684be923 #REFACTORING
mawalch
parents: 603
diff changeset
   575
    ^ '$Header$'
297
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   576
!
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   577
87eb8f911bcf changed: #exceptionInfoStringFor:in:
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   578
version_CVS
629
05b7684be923 #REFACTORING
mawalch
parents: 603
diff changeset
   579
    ^ '$Header$'
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   580
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   581
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   582
version_SVN
629
05b7684be923 #REFACTORING
mawalch
parents: 603
diff changeset
   583
    ^ '$Id$'
14
a4a5478621e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6
diff changeset
   584
! !
549
965efa0c6e36 class: TestResult
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   585