ExampleTestResource.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 21 May 2024 14:45:43 +0100
branchjv
changeset 784 10e743d12eb3
parent 724 4dae63fce9f9
permissions -rw-r--r--
Fix `TestResult >> hasPassed` w.r.t all skipped tests This commit fixes `#hasPassed` in edge cases when all test were skipped. In this case, `#hasPassed` should return `false`. This happens when asking for test result of a single test that has been skipped or did not run at all.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
724
4dae63fce9f9 vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 664
diff changeset
     1
"{ Encoding: utf8 }"
4dae63fce9f9 vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 664
diff changeset
     2
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:goodies/sunit' }"
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
     5
"{ NameSpace: Smalltalk }"
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
     6
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
TestResource subclass:#ExampleTestResource
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	instanceVariableNames:'runningState'
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	classVariableNames:''
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	poolDictionaries:''
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	category:'SUnit-Tests'
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    15
!ExampleTestResource class methodsFor:'testing'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
isAvailable
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	^super isAvailable and: [self current isStarted]
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    22
!ExampleTestResource methodsFor:'accessing'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
runningState
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	^runningState
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
runningState: aSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	runningState := aSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    34
!ExampleTestResource methodsFor:'constants'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
	^#started
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
stoppedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
	^#stopped
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    46
!ExampleTestResource methodsFor:'running'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
setUp
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    49
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
	self runningState: self startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
tearDown
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
	self runningState: self stoppedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
68
9fd111438d60 category renames (lower case)
Claus Gittinger <cg@exept.de>
parents: 46
diff changeset
    58
!ExampleTestResource methodsFor:'testing'!
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
isAvailable
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    61
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
	^self runningState == self startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
isStarted
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    66
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
	^self runningState == self startedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
isStopped
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    71
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
	^self runningState == self stoppedStateSymbol
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
! !
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
!ExampleTestResource class methodsFor:'documentation'!
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
version
222
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    78
    ^ '$Header: /cvs/stx/stx/goodies/sunit/ExampleTestResource.st,v 1.3 2011-06-29 19:15:49 cg Exp $'
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    79
!
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    80
8e6f482297fa Jan's 4.1 version
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    81
version_SVN
724
4dae63fce9f9 vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 664
diff changeset
    82
    ^ '§Id: ExampleTestResource.st 182 2009-12-05 18:12:17Z vranyj1 §'
46
eb19d69beb10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
! !
664
e31b2e7b658d FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 222
diff changeset
    84