Tools__TestRunnerEmbedded.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 04 Apr 2013 19:06:16 +0100
branchjv
changeset 12650 e0f607754b9a
parent 12431 9f0c59c742d5
parent 12604 8d8912ec9551
child 12807 ba8c5416aa28
permissions -rw-r--r--
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10092
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     2
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     3
 Copyright (c) 2009-2010 eXept Software AG
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10092
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     5
 Permission is hereby granted, free of charge, to any person
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     6
 obtaining a copy of this software and associated documentation
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     7
 files (the 'Software'), to deal in the Software without
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     8
 restriction, including without limitation the rights to use,
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
     9
 copy, modify, merge, publish, distribute, sublicense, and/or sell
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    10
 copies of the Software, and to permit persons to whom the
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    11
 Software is furnished to do so, subject to the following
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    12
 conditions:
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    13
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    14
 The above copyright notice and this permission notice shall be
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    15
 included in all copies or substantial portions of the Software.
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    16
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    17
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    18
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    19
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    20
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    21
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    22
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    23
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    24
 OTHER DEALINGS IN THE SOFTWARE.
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
AbstractTestRunner subclass:#TestRunnerEmbedded
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
    31
	instanceVariableNames:'runnerPanel selectedClassesHolder selectedProtocolsHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
    32
		selectedMethodsHolder methodGeneratorHolder resultHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
    33
		resultInfoHolder resultBackgroundColorHolder runningHolder
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    34
		progressHolder progressIndicatorShownHolder infoHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    35
		testProcess allTestCases'
10647
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    36
	classVariableNames:''
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    37
	poolDictionaries:''
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    38
	category:'SUnit-UI'
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
Object subclass:#SuiteAndResult
10647
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    42
	instanceVariableNames:'suite result'
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    43
	classVariableNames:''
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    44
	poolDictionaries:''
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
    45
	privateIn:TestRunnerEmbedded
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
!TestRunnerEmbedded class methodsFor:'documentation'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
copyright
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
"
10092
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    52
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    53
 Copyright (c) 2009-2010 eXept Software AG
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    54
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    55
 Permission is hereby granted, free of charge, to any person
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    56
 obtaining a copy of this software and associated documentation
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    57
 files (the 'Software'), to deal in the Software without
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    58
 restriction, including without limitation the rights to use,
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    59
 copy, modify, merge, publish, distribute, sublicense, and/or sell
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    60
 copies of the Software, and to permit persons to whom the
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    61
 Software is furnished to do so, subject to the following
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    62
 conditions:
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
10092
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    64
 The above copyright notice and this permission notice shall be
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    65
 included in all copies or substantial portions of the Software.
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    66
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    67
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    68
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    69
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    70
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    71
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    72
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    73
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
b088e3df4982 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9956
diff changeset
    74
 OTHER DEALINGS IN THE SOFTWARE.
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
"
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
    76
!
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
    77
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
    78
documentation
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
    79
"
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
    80
    a tiny runner to be embedded in a system browser
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
    81
"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    84
!TestRunnerEmbedded class methodsFor:'help specs'!
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    85
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    86
flyByHelpSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    87
    "This resource specification was automatically generated
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    88
     by the UIHelpTool of ST/X."
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    89
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    90
    "Do not manually edit this!! If it is corrupted,
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    91
     the UIHelpTool may not be able to read the specification."
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    92
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    93
    "
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    94
     UIHelpTool openOnClass:Tools::TestRunnerEmbedded    
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    95
    "
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    96
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    97
    <resource: #help>
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    98
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
    99
    ^ super flyByHelpSpec addPairsFrom:#(
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   100
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   101
#debugSelected
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   102
'Run the selected test(s) with debugging enabled'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   103
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   104
#runAll
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   105
'Run all tests'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   106
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   107
#runFailed
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   108
'Only rerun failed tests'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   109
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   110
#runSelected
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   111
'Run the selected test(s)'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   112
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   113
#stopRun
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   114
'Stop the test-run'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   115
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   116
)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   117
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   118
    "Created: / 04-06-2012 / 19:27:47 / cg"
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   119
! !
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   120
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
!TestRunnerEmbedded class methodsFor:'interface specs'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
windowSpec
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    "This resource specification was automatically generated
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
     by the UIPainter of ST/X."
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "Do not manually edit this!! If it is corrupted,
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
     the UIPainter may not be able to read the specification."
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    "
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
     UIPainter new openOnClass:Tools::TestRunnerEmbedded andSelector:#windowSpec
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
     Tools::TestRunnerEmbedded new openInterface:#windowSpec
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
     Tools::TestRunnerEmbedded open
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    "
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    <resource: #canvas>
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    ^ 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
     #(FullSpec
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        name: windowSpec
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
        window: 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
       (WindowSpec
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
          label: 'Test Runner Embedded'
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
          name: 'Test Runner Embedded'
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
          min: (Point 10 10)
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   146
          bounds: (Rectangle 0 0 595 50)
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
        )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
        component: 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
       (SpecCollection
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
          collection: (
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   151
           (ViewSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   152
              name: 'Runner'
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
              layout: (LayoutFrame 5 0 0 0 -5 1 0 1)
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   154
              backgroundChannel: resultBackgroundColorAspect
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
              component: 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
             (SpecCollection
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
                collection: (
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   158
                 (HorizontalPanelViewSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   159
                    name: 'RunnerInnerBox'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   160
                    layout: (LayoutFrame 5 0 0 0 -5 1 0 1)
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
                    backgroundChannel: resultBackgroundColorAspect
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   162
                    horizontalLayout: rightSpaceFit
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   163
                    verticalLayout: center
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   164
                    horizontalSpace: 0
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   165
                    elementsChangeSize: true
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
                    component: 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
                   (SpecCollection
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
                      collection: (
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   169
                       (ViewSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   170
                          name: 'RunnerInfoBox'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   171
                          backgroundChannel: resultBackgroundColorAspect
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
                          component: 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
                         (SpecCollection
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
                            collection: (
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   175
                             (LabelSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   176
                                label: 'Run tests first!!'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   177
                                name: 'ResultName'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   178
                                layout: (LayoutFrame 0 0 0 0 0 1 -10 1)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   179
                                backgroundChannel: resultBackgroundColorAspect
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   180
                                foregroundColor: (Color 100.0 100.0 100.0)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   181
                                translateLabel: true
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   182
                                labelChannel: resultNameAspect
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   183
                                adjust: left
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   184
                              )
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   185
                             (LabelSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   186
                                name: 'ResultInfo'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   187
                                layout: (LayoutFrame 0 0 -10 1 0 1 0 1)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   188
                                style: (FontDescription helvetica medium roman 8 #'iso10646-1')
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   189
                                backgroundChannel: resultBackgroundColorAspect
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   190
                                foregroundColor: (Color 100.0 100.0 100.0)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   191
                                translateLabel: true
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   192
                                labelChannel: resultInfoAspect
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   193
                                adjust: left
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   194
                              )
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
                             (ViewSpec
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   196
                                name: 'ProgressPanel'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   197
                                layout: (LayoutFrame 0 0 0 0 0 1 0 1)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   198
                                visibilityChannel: progressIndicatorShownHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
                                backgroundChannel: resultBackgroundColorAspect
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
                                component: 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
                               (SpecCollection
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
                                  collection: (
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   203
                                   (ProgressIndicatorSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   204
                                      name: 'RunningProgress'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   205
                                      layout: (LayoutFrame 5 0 -10 0.5 -5 1 10 0.5)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   206
                                      model: progressHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
                                    )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
                                   )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
                                 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
                                )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
                              )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
                             )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
                           
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
                          )
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   215
                          extent: (Point 276 30)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   216
                        )
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   217
                       (ActionButtonSpec
11568
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   218
                          label: 'Debug'
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   219
                          name: 'DebugButton'
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   220
                          activeHelpKey: debugSelected
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   221
                          translateLabel: true
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   222
                          model: debug
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   223
                          enableChannel: runEnabledHolder
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   224
                          extent: (Point 60 25)
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   225
                        )
87587d70289b changed: #windowSpec
Claus Gittinger <cg@exept.de>
parents: 11567
diff changeset
   226
                       (ActionButtonSpec
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   227
                          label: 'Stop'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   228
                          name: 'Button2'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   229
                          activeHelpKey: stopRun
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   230
                          visibilityChannel: runningHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   231
                          translateLabel: true
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   232
                          model: stop
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   233
                          extent: (Point 60 25)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   234
                        )
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   235
                       (ActionButtonSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   236
                          label: 'Run'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   237
                          name: 'Run'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   238
                          activeHelpKey: runSelected
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   239
                          visibilityChannel: notRunningHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   240
                          translateLabel: true
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   241
                          model: run
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   242
                          enableChannel: runEnabledHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   243
                          extent: (Point 60 25)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   244
                        )
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   245
                       (ActionButtonSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   246
                          label: 'Run Failed'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   247
                          name: 'Button1'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   248
                          activeHelpKey: runFailed
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   249
                          translateLabel: true
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   250
                          model: runFailed
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   251
                          enableChannel: runFailedEnabledHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   252
                          extent: (Point 60 25)
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   253
                        )
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   254
                       (ActionButtonSpec
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   255
                          label: 'Run all'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   256
                          name: 'RunAll'
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   257
                          activeHelpKey: runAll
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   258
                          translateLabel: true
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   259
                          model: runAll
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   260
                          enableChannel: runAllEnabledHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   261
                          extent: (Point 60 25)
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
                        )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
                       )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
                     
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
                    )
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   266
                    postBuildCallback: postBuildRunnerPanel:
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
                  )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
                 )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
               
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
              )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
            )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
           )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
         
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
        )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
      )
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
!TestRunnerEmbedded class methodsFor:'plugIn spec'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
aspectSelectors
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
    "This resource specification was automatically generated
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
     by the UIPainter of ST/X."
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
    "Do not manually edit this. If it is corrupted,
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
     the UIPainter may not be able to read the specification."
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    "Return a description of exported aspects;
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
     these can be connected to aspects of an embedding application
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
     (if this app is embedded in a subCanvas)."
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    ^ #(
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
        #methodGeneratorHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
        #selectedClassesHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
        #selectedMethodsHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
        #selectedProtocolsHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
      ).
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
!TestRunnerEmbedded methodsFor:'accessing'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   303
allTestCases
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   304
    allTestCases isNil ifTrue:[
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   305
        self updateTestCases
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   306
    ].
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   307
    ^ allTestCases
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   308
!
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   309
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   310
infoHolder:something
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   311
    "to show something in the browsers info area (near the bottom"
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   312
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   313
    infoHolder := something.
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   314
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   315
    "Created: / 05-07-2011 / 16:22:24 / cg"
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   316
!
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   317
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   318
invalidateAllTestCases
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   319
    allTestCases := nil
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
12309
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   322
selectedTestMethods
12308
5d9291c0fc27 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12303
diff changeset
   323
12309
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   324
    | selectedClass |
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   325
    selectedClass := self theSingleTestCase.
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   326
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   327
    ^ (self selectedMethodsHolder value ? #()) select:
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   328
            [:mthd | | cls |
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   329
            (cls := selectedClass) isNil ifTrue:[cls := mthd mclass].
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   330
            (self isTestCaseLike:selectedClass) 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   331
                and:[ selectedClass isTestSelector:mthd selector ] ]
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   332
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   333
    "Created: / 15-03-2010 / 13:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   334
    "Modified: / 22-07-2011 / 15:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   335
    "Modified: / 02-08-2011 / 17:46:38 / cg"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   336
!
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   337
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   338
selectedTestMethodsFromProtocols:protocols 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   339
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   340
    |methods generator selectedClass|
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   341
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   342
    methods := Set new.
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   343
    generator := self methodGeneratorHolder value.
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   344
    selectedClass := self theSingleTestCase.
12308
5d9291c0fc27 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12303
diff changeset
   345
12309
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   346
    generator notNil ifTrue:[ 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   347
        generator do: [:cls :cat :sel :mthd | 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   348
            (mthd notNil 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   349
                and:[ (self isTestCaseLike:(selectedClass ? cls)) 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   350
                and:[ (selectedClass ? cls) isTestSelector:sel ] ]) 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   351
            ifTrue:[ methods add:mthd ] 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   352
        ] 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   353
    ] ifFalse:[
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   354
        allTestCases do: [:cls | 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   355
            cls methodsDo: [:mthd | 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   356
                ((protocols includes:mthd category) and:[ cls isTestSelector:mthd selector ]) 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   357
                ifTrue:[ 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   358
                    methods add:mthd 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   359
                ] 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   360
            ] 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   361
        ] 
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   362
    ].
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   363
    ^ methods
12308
5d9291c0fc27 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12303
diff changeset
   364
12309
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   365
    "Created: / 15-03-2010 / 19:50:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   366
    "Modified: / 22-07-2011 / 15:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   367
    "Modified (format): / 04-06-2012 / 19:05:32 / cg"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   368
!
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   369
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   370
selectedTestMethodsFromProtocols:protocols inClass:aTestClass
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   371
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   372
    |methods generator|
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
    methods := Set new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
    generator := self methodGeneratorHolder value.
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   376
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   377
    generator notNil ifTrue:[ 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   378
        generator do: [:cls :cat :sel :mthd | 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   379
            (mthd notNil 
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   380
                and:[ (self isTestCaseLike:(aTestClass ? cls)) 
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   381
                and:[ (aTestClass ? cls) isTestSelector:sel ] ]) 
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   382
            ifTrue:[ methods add:mthd ] 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   383
        ] 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   384
    ] ifFalse:[
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   385
        self allTestCases do: [:cls | 
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   386
            cls methodsDo: [:mthd | 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   387
                ((protocols includes:mthd category) and:[ cls isTestSelector:mthd selector ]) 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   388
                ifTrue:[ 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   389
                    methods add:mthd 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   390
                ] 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   391
            ] 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   392
        ] 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   393
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
    ^ methods
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
    "Created: / 15-03-2010 / 19:50:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   397
    "Modified: / 22-07-2011 / 15:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   398
    "Modified (format): / 04-06-2012 / 19:05:32 / cg"
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   399
!
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   400
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   401
selectedTestMethodsInClass:testClass
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   402
    ^ (self selectedMethodsHolder value ? #()) select:
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   403
            [:mthd | | cls |
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   404
            (cls := testClass) isNil ifTrue:[cls := mthd mclass].
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   405
            (self isTestCaseLike:testClass) 
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   406
                and:[ testClass isTestSelector:mthd selector ] ]
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   407
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   408
    "Created: / 15-03-2010 / 13:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   409
    "Modified: / 22-07-2011 / 15:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   410
    "Modified: / 02-08-2011 / 17:46:38 / cg"
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   411
!
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   412
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   413
theSingleTestCase
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   414
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   415
    self allTestCases isEmptyOrNil ifTrue:[^nil].
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   416
    allTestCases size > 1 ifTrue:[^nil].
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   417
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   418
    ^allTestCases anyOne.
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   419
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
   420
    "Created: / 22-07-2011 / 15:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
!TestRunnerEmbedded methodsFor:'actions'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
debug
12055
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   426
    | suiteAndResult suite result | 
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
    suiteAndResult := self resultHolder value.
10647
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
   429
    suite := suiteAndResult suiteForRun.
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   430
    "/ suite tests size ~= 1 ifTrue:[^self breakPoint: #jv].
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   431
    "/ test := suiteAndResult suite tests anyOne.
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   432
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   433
    self stop.
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   434
12055
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   435
    "/ debug run is synchronous
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   436
    [
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   437
        self runningHolder value:true.
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   438
12055
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   439
        suite tests do:[:test |
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   440
            [
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   441
                test debug. 
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   442
            ] on: AbortAllOperationRequest do:[:ex|].
12055
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   443
            (test class testSelectorPassed:test selector) ifTrue:[
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   444
                result := TestResult defaultResultClass new.
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   445
                result passed add: test.
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   446
                suiteAndResult := SuiteAndResult suite: suite result: result.       
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   447
                self resultHolder value:suiteAndResult.    
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   448
            ].
12055
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   449
        ].
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   450
    ] ensure:[
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   451
        self runningHolder value:false.
266a7b6585ed lastState fixes
Claus Gittinger <cg@exept.de>
parents: 11966
diff changeset
   452
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    "Created: / 15-03-2010 / 15:43:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10243
f8b2067424ed changed: #debug: bug fix: if the test pass when debugging, update the UI
vrany
parents: 10201
diff changeset
   455
    "Modified: / 07-07-2011 / 11:33:48 / Jan Vrany <jan.vrant@fit.cvut,cz>"
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   456
    "Modified: / 04-06-2012 / 19:46:38 / cg"
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   457
    "Modified: / 03-12-2012 / 14:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
run
10789
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   461
    |suite|
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
10789
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   463
    resultHolder value isNil ifTrue:[
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   464
        suite := self suiteForRun
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   465
    ] ifFalse:[
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   466
        suite := resultHolder value suiteForRun
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   467
    ].
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   468
    self run:suite
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
    "Created: / 10-03-2010 / 19:42:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10647
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
   471
    "Modified: / 22-08-2011 / 09:58:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10789
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   472
    "Modified: / 09-10-2011 / 10:56:39 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   475
run:suite 
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   476
    ^self run: suite debug: false
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   477
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   478
    "Created: / 11-03-2010 / 10:22:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   479
    "Modified: / 09-06-2012 / 20:23:58 / cg"
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   480
    "Modified: / 03-12-2012 / 13:59:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   481
!
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   482
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   483
run:suite debug: debug 
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   484
    |suiteAndResult numTests|
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
10201
abe808684440 changed: #run:
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   486
    numTests := suite tests size.
abe808684440 changed: #run:
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   487
    numTests == 0 ifTrue:[
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   488
        ^ self
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   489
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   491
    self stop.
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   492
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   493
    testProcess := [
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   494
                |result incr run|
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   496
                result := debug ifFalse:[TestResult new] ifTrue:[TestResultForRunWithDebug].
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   497
                [
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   498
                    self runningHolder value:true.
11570
4981b01822ff changed: #run:
Claus Gittinger <cg@exept.de>
parents: 11568
diff changeset
   499
                    self progressIndicatorShownHolder value:(numTests > 1).
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   500
                    self progressHolder value:0.
10201
abe808684440 changed: #run:
Claus Gittinger <cg@exept.de>
parents: 10184
diff changeset
   501
                    incr := 100 / numTests.
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   502
                    run := 0.
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   503
                    result := suite 
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   504
                                run: result
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   505
                                beforeEachDo:[:test :result |
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   506
                                    infoHolder notNil ifTrue:[
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   507
                                        infoHolder value:('Running "%1-%2"...' 
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   508
                                                        bindWith:test name
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   509
                                                        with:test getTestName allBold)
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   510
                                    ]
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   511
                                ]
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   512
                                afterEachDo:[:test :result | 
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   513
                                    run := run + 1.
10184
e5ea0ea47ea5 changed: #run:
Claus Gittinger <cg@exept.de>
parents: 10178
diff changeset
   514
                                    self progressHolder value:(incr * run) truncated "rounded".
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   515
                                    infoHolder notNil ifTrue:[
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   516
                                        infoHolder value:('Done.')
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   517
                                    ]
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   518
                                ]
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   519
                                debug: debug.
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   520
                    suiteAndResult := SuiteAndResult suite:suite result:result.
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   521
                ] ensure:[
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   522
                    self progressIndicatorShownHolder value:false.
10175
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   523
                    self resultHolder value:suiteAndResult.
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   524
                    self runningHolder value:false.
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   525
                ]
7d8b7151c5a0 class definition
Claus Gittinger <cg@exept.de>
parents: 10165
diff changeset
   526
            ] newProcess.
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   527
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   528
    testProcess priority:(Processor userBackgroundPriority).
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   529
    testProcess resume.
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   531
    "Created: / 03-12-2012 / 13:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
runAll
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   536
    self run: (self suiteForRunAll).
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
    "Created: / 10-03-2010 / 19:42:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
    "Modified: / 15-03-2010 / 13:12:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   540
    "Modified: / 04-06-2012 / 19:00:14 / cg"
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   541
!
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   542
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   543
runFailed
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   544
    self run: self suiteForRunFailed.
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   545
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   546
    "Created: / 04-06-2012 / 18:32:19 / cg"
10178
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   547
!
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   548
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   549
runWithDebug
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   550
    "/ cg: I really do not want to run them twice to get a debugger 
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   551
    "/ - I want to run them either with a debugger coming right away, or not.
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   552
10606
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
   553
    | suiteAndResult suite|
10178
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   554
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   555
    suiteAndResult := self resultHolder value.
10789
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   556
    suiteAndResult isNil ifTrue:[
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   557
        suite := self suiteForRun.
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   558
    ] ifFalse:[
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   559
        suite := suiteAndResult suiteForRun.
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   560
    ].
10608
f2c0f609469a sUnit fixes
vrany
parents: 10606
diff changeset
   561
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   562
    self run: suite debug: true
10178
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   563
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   564
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   565
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   566
    "/ suiteAndResult suite tests size ~= 1 ifTrue:[^self breakPoint: #jv].
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   567
    "/ [suiteAndResult suite tests anyOne debug] fork
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   568
f5a662f12a4d added: #runWithDebug
Claus Gittinger <cg@exept.de>
parents: 10175
diff changeset
   569
    "Created: / 05-07-2011 / 18:45:43 / cg"
10789
1754bb4e8281 changed:
Claus Gittinger <cg@exept.de>
parents: 10647
diff changeset
   570
    "Modified: / 09-10-2011 / 10:55:46 / cg"
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
   571
    "Modified: / 03-12-2012 / 13:59:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   572
!
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   573
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   574
stop
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   575
    |p|
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   576
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   577
    (p := testProcess) notNil ifTrue:[
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   578
        testProcess := nil.
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   579
        p terminate
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   580
    ].
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   581
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   582
    "Created: / 04-06-2012 / 18:34:07 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
!TestRunnerEmbedded methodsFor:'aspects'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
debugVisibleAspect
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   588
    ^ BlockValue 
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   589
        with:[:model | 
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   590
            model notNil
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   591
            and:[ model testCount == 1 
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   592
            and:[ model hasFailuresOrErrors ]]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   593
        ]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   594
        argument:self resultHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
    "Created: / 15-03-2010 / 15:40:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   597
    "Modified: / 02-08-2011 / 18:19:14 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
methodGeneratorHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
    "return/create the 'methodGeneratorHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
    methodGeneratorHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
        methodGeneratorHolder := ValueHolder new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
        methodGeneratorHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
    ^ methodGeneratorHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
methodGeneratorHolder:something
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
    "set the 'methodGeneratorHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
    |oldValue newValue|
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
    methodGeneratorHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
        oldValue := methodGeneratorHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
        methodGeneratorHolder removeDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
    methodGeneratorHolder := something.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
    methodGeneratorHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
        methodGeneratorHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
    newValue := methodGeneratorHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
    oldValue ~~ newValue ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
        self update:#value with:newValue from:methodGeneratorHolder.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   629
notRunningHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   630
    ^ BlockValue forLogicalNot:(self runningHolder)
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   631
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   632
    "Created: / 04-06-2012 / 18:38:48 / cg"
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   633
!
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   634
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
progressHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
    "return/create the 'progressHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
    progressHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
        progressHolder := ValueHolder new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
    ^ progressHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   644
progressIndicatorShownHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   645
    progressIndicatorShownHolder isNil ifTrue:[
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   646
        progressIndicatorShownHolder := ValueHolder with: false.
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   647
    ].
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   648
    ^ progressIndicatorShownHolder
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   649
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   650
    "Modified: / 15-03-2010 / 20:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   651
    "Modified (comment): / 04-06-2012 / 18:38:52 / cg"
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   652
    "Created: / 04-06-2012 / 19:42:59 / cg"
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   653
!
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   654
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
resultBackgroundColorAspect
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
    <resource: #uiAspect>
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
    resultBackgroundColorHolder isNil ifTrue:[
10165
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   658
        resultBackgroundColorHolder := BlockValue 
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   659
                    with:[:result :running | 
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   660
                        running ifTrue:[
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   661
                            self class currentlyRunningColor "/ View defaultBackgroundColor
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   662
                        ] ifFalse:[
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   663
                            result ifNil:[ self class notRunColor ] ifNotNil:[ result color ]
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   664
                        ].
10165
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   665
                    ]
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   666
                    argument:self resultHolder
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   667
                    argument:self runningHolder.
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   668
        resultBackgroundColorHolder 
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   669
            onChangeEvaluate:[
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   670
                runnerPanel 
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   671
                    ifNotNil:[ runnerPanel backgroundColor:resultBackgroundColorHolder value ]
fd4de5081321 changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents: 10092
diff changeset
   672
            ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   673
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
    ^ resultBackgroundColorHolder.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   675
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   676
    "Created: / 15-03-2010 / 15:22:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   677
    "Modified: / 15-03-2010 / 21:02:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11553
d510e15157cd class definition
Claus Gittinger <cg@exept.de>
parents: 11552
diff changeset
   678
    "Modified: / 04-06-2012 / 19:40:11 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   680
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   681
resultHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
    "return/create the 'resultHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
    resultHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   685
        resultHolder := ValueHolder new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
    ^ resultHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   690
resultInfoAspect
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   691
    ^ BlockValue 
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   692
        with:[:model | model isNil ifTrue:[ '' ] ifFalse:[ model info ] ]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   693
        argument:self resultHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
    "Created: / 15-03-2010 / 20:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   696
    "Modified: / 02-08-2011 / 18:20:26 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
resultNameAspect
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   700
    ^ BlockValue 
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   701
        with:[:model | model isNil ifTrue:[ 'Run the tests!!' ] ifFalse:[ model name ] ]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   702
        argument:self resultHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   703
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   704
    "Created: / 15-03-2010 / 14:57:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   705
    "Modified: / 15-03-2010 / 20:17:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
   706
    "Modified: / 02-08-2011 / 18:20:38 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   707
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   708
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
runAllEnabledHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   710
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   711
    ^ self notRunningHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   712
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   713
    "Created: / 07-09-2010 / 09:15:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   714
    "Modified: / 04-06-2012 / 18:40:46 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   715
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   716
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   717
runEnabledHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
    ^BlockValue
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   719
        with:
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   720
            [:result :running | 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   721
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   722
            running not
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   723
            and:[ result notNil 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   724
            and:[ result testCount > 0 ]]
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   725
        ]
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
        argument: self resultHolder
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   727
        argument: self runningHolder
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
    "Created: / 07-09-2010 / 09:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   730
    "Modified: / 04-06-2012 / 18:52:41 / cg"
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   731
!
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   732
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   733
runFailedEnabledHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   734
    ^BlockValue
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   735
        with:
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   736
            [:running | 
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   737
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   738
            |result|
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   739
11584
59a6902c041b Fix for not autoloaded SUnit
Stefan Vogel <sv@exept.de>
parents: 11570
diff changeset
   740
            running not
11600
53100c5a7473 changed: #runFailedEnabledHolder (fix for environments without SUnit loaded)
vrany
parents: 11584
diff changeset
   741
            and:[ TestResult notNil 
11584
59a6902c041b Fix for not autoloaded SUnit
Stefan Vogel <sv@exept.de>
parents: 11570
diff changeset
   742
            and:[ TestResult isLoaded
59a6902c041b Fix for not autoloaded SUnit
Stefan Vogel <sv@exept.de>
parents: 11570
diff changeset
   743
            and:[ result := self resultForSuite:self suiteForRunAll. result notNil 
11600
53100c5a7473 changed: #runFailedEnabledHolder (fix for environments without SUnit loaded)
vrany
parents: 11584
diff changeset
   744
            and:[ result hasFailuresOrErrors ]]]]
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   745
        ]
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   746
        "/ argument: self resultHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   747
        argument: self runningHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   748
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   749
    "Created: / 07-09-2010 / 09:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   750
    "Created: / 04-06-2012 / 18:28:12 / cg"
11600
53100c5a7473 changed: #runFailedEnabledHolder (fix for environments without SUnit loaded)
vrany
parents: 11584
diff changeset
   751
    "Modified: / 18-07-2012 / 09:55:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
runningHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
    runningHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
        runningHolder := ValueHolder with: false.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
    ^ runningHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
    "Modified: / 15-03-2010 / 20:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   761
    "Modified (comment): / 04-06-2012 / 18:38:52 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   763
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
selectedClassesHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
    "return/create the 'selectedClassesHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   766
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
    selectedClassesHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
        selectedClassesHolder := ValueHolder new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
        selectedClassesHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   770
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
    ^ selectedClassesHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
selectedClassesHolder:something
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
    "set the 'selectedClassesHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   776
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   777
    |oldValue newValue|
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
    selectedClassesHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
        oldValue := selectedClassesHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
        selectedClassesHolder removeDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
    selectedClassesHolder := something.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
    selectedClassesHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
        selectedClassesHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
    newValue := selectedClassesHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
    oldValue ~~ newValue ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
        self update:#value with:newValue from:selectedClassesHolder.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   790
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
selectedMethodsHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   794
    "return/create the 'selectedMethodsHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
    selectedMethodsHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
        selectedMethodsHolder := ValueHolder new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
        selectedMethodsHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   800
    ^ selectedMethodsHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   801
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   802
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   803
selectedMethodsHolder:something
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   804
    "set the 'selectedMethodsHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   805
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   806
    |oldValue newValue|
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   807
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
    selectedMethodsHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
        oldValue := selectedMethodsHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
        selectedMethodsHolder removeDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
    selectedMethodsHolder := something.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
    selectedMethodsHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
        selectedMethodsHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
    newValue := selectedMethodsHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
    oldValue ~~ newValue ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
        self update:#value with:newValue from:selectedMethodsHolder.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   820
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
selectedProtocolsHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   823
    "return/create the 'selectedProtocolsHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   824
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   825
    selectedProtocolsHolder isNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
        selectedProtocolsHolder := ValueHolder new.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
        selectedProtocolsHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
    ^ selectedProtocolsHolder
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
selectedProtocolsHolder:something
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   833
    "set the 'selectedProtocolsHolder' value holder (automatically generated)"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   835
    |oldValue newValue|
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   837
    selectedProtocolsHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
        oldValue := selectedProtocolsHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
        selectedProtocolsHolder removeDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   840
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
    selectedProtocolsHolder := something.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   842
    selectedProtocolsHolder notNil ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
        selectedProtocolsHolder addDependent:self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
    newValue := selectedProtocolsHolder value.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
    oldValue ~~ newValue ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
        self update:#value with:newValue from:selectedProtocolsHolder.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   848
    ].
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   849
!
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   850
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   851
stopEnabledHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   852
    ^ self runningHolder
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   853
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   854
    "Created: / 04-06-2012 / 18:29:01 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   855
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   856
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   857
!TestRunnerEmbedded methodsFor:'change & update'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   858
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   859
invalidateSuiteAndResult
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   860
    self resultHolder value:nil.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   861
!
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   862
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   863
invalidateTestCases
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   864
    allTestCases := nil.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   865
!
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   866
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
update:aspect with:param from: sender
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   868
    "Invoked when an object that I depend upon sends a change notification."
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   870
    sender == selectedClassesHolder ifTrue:[
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   871
        self 
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   872
            invalidateTestCases;      "/ updateTestSuite;
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   873
            invalidateSuiteAndResult; "/ updateTestSuiteAndResult;
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
            updateVisibility.
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   875
        self enqueueDelayedAction:[ self updateTestCases; updateSuiteAndResult ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
         ^ self.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
    sender == selectedProtocolsHolder ifTrue:[
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   879
        self invalidateSuiteAndResult. "/ updateTestSuiteAndResult.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   880
        self enqueueDelayedAction:[ self updateSuiteAndResult ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
        ^self
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   883
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
    sender == selectedMethodsHolder ifTrue:[
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   885
        self invalidateSuiteAndResult. "/ updateTestSuiteAndResult.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   886
        self enqueueDelayedAction:[ self updateSuiteAndResult ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
        ^self
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
    sender == methodGeneratorHolder ifTrue:[
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   890
        self invalidateSuiteAndResult. "/ updateTestSuiteAndResult.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   891
        self enqueueDelayedAction:[ self updateSuiteAndResult ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
        ^self
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
    ].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
10862
vrany
parents: 10789
diff changeset
   895
    sender == Smalltalk ifTrue:[
vrany
parents: 10789
diff changeset
   896
        aspect == #lastTestRunResult ifTrue:[
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   897
            allTestCases notNil ifTrue:[
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   898
                (allTestCases includesIdentical: param first) ifTrue:[
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   899
                    self invalidateSuiteAndResult. "/ updateTestSuiteAndResult.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   900
                    self enqueueDelayedAction:[ self updateSuiteAndResult ].
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   901
                    ^self        
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   902
                ]
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   903
            ].
10862
vrany
parents: 10789
diff changeset
   904
        ]        
vrany
parents: 10789
diff changeset
   905
    ].
vrany
parents: 10789
diff changeset
   906
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
    super update:aspect with:param from: sender
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   910
10886
8619db59aff4 bug fix in: #update:with:from: (selectedTestCases ivar might be nil)
vrany
parents: 10862
diff changeset
   911
    "Modified: / 20-11-2011 / 12:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   912
    "Modified: / 04-06-2012 / 19:03:34 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   915
updateSuiteAndResult
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   916
    | suite suiteAndResult |
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   917
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   918
    self runningHolder value ifTrue:[^self].
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   919
    self allTestCases isEmptyOrNil ifTrue:[^self].
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   920
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   921
    suiteAndResult := SuiteAndResult
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   922
                        suite:  (suite := self suiteForRun)
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   923
                        result: (self resultForSuite: suite).
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   924
    self resultHolder value: suiteAndResult.
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   925
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   926
    "Created: / 15-03-2010 / 19:41:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   927
    "Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   928
    "Modified: / 04-06-2012 / 19:03:15 / cg"
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   929
!
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
   930
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   931
updateTestCases
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   932
    allTestCases := ((self selectedClassesHolder value ? #()) 
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
                select:[:cls | self isTestCaseLike:cls ]).
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   934
    allTestCases := allTestCases asArray
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   936
    "Created: / 11-03-2010 / 10:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11197
86b60ba78ad2 changed: #updateTestCases
vrany
parents: 10886
diff changeset
   937
    "Modified: / 24-01-2012 / 22:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
   938
    "Modified: / 04-06-2012 / 19:02:52 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   939
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
12309
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   941
updateTestSuiteAndResult
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
12309
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   943
    | suite suiteAndResult |
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   944
    self runningHolder value ifTrue:[^self].
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   945
    allTestCases isEmptyOrNil ifTrue:[^self].
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   946
    suiteAndResult := SuiteAndResult
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   947
                        suite:  (suite := self suiteForRun)
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   948
                        result: (self resultForSuite: suite).
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   949
    self resultHolder value: suiteAndResult.
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   950
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   951
    "Created: / 15-03-2010 / 19:41:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   952
    "Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   953
    "Modified: / 04-06-2012 / 19:03:15 / cg"
1dceb2eb9139 Added missing methods (after bad merge)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12308
diff changeset
   954
!
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   956
updateVisibility
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   957
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   958
    self hasTestCaseSelected 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   959
        ifTrue:[self show]
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
        ifFalse:[self hide]
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   961
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   962
    "Created: / 11-03-2010 / 09:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   963
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   964
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
!TestRunnerEmbedded methodsFor:'hooks'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
10862
vrany
parents: 10789
diff changeset
   967
commonPostOpen
vrany
parents: 10789
diff changeset
   968
vrany
parents: 10789
diff changeset
   969
    Smalltalk addDependent: self.
vrany
parents: 10789
diff changeset
   970
vrany
parents: 10789
diff changeset
   971
    "Created: / 17-11-2011 / 20:59:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10789
diff changeset
   972
!
vrany
parents: 10789
diff changeset
   973
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
postBuildRunnerPanel: aView
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
    runnerPanel := aView.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
    runnerPanel backgroundColor: self resultBackgroundColorAspect value
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   979
    "Created: / 15-03-2010 / 14:26:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10862
vrany
parents: 10789
diff changeset
   980
!
vrany
parents: 10789
diff changeset
   981
vrany
parents: 10789
diff changeset
   982
releaseAsSubCanvas
vrany
parents: 10789
diff changeset
   983
vrany
parents: 10789
diff changeset
   984
    Smalltalk removeDependent: self.
vrany
parents: 10789
diff changeset
   985
vrany
parents: 10789
diff changeset
   986
    "Created: / 17-11-2011 / 21:03:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   988
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
!TestRunnerEmbedded methodsFor:'private'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   990
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
hide
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   992
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
    self visibility: false height: 0
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   994
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   995
    "Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
isTestCaseLike:cls 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   999
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1000
    ^(super isTestCaseLike: cls) and:
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1001
        [(cls askFor: #isAbstract) not]
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1002
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1003
    "Modified: / 04-03-2011 / 06:54:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1004
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1005
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1006
show
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1007
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1008
    self visibility: true height: 50
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1009
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1010
    "Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1011
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
10564
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1013
visibility:visibility height:height 
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1014
    |container list h|
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1015
10564
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1016
    (container := self window container) ifNil:[ ^ self ].
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1017
    h := visibility ifFalse:[0] ifTrue:[ height ].
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1018
    container isVisible == visibility ifFalse:[
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1019
        container isVisible:visibility
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1020
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1021
    list := container container subViews first.
10564
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1022
    (list layout bottomOffset ~= height negated) ifTrue:[
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1023
        list layout:((list layout)
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1024
                    bottomOffset:height negated;
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1025
                    yourself)
4e109c7b8ee8 comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents: 10563
diff changeset
  1026
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1028
    "Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1029
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1030
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1031
!TestRunnerEmbedded methodsFor:'queries'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
hasTestCaseSelected
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1035
    ^self allTestCases notEmptyOrNil
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1036
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
    "Created: / 11-03-2010 / 09:06:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
    "Modified: / 15-03-2010 / 20:54:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10454
8baf1e0c120e changed:
Claus Gittinger <cg@exept.de>
parents: 10432
diff changeset
  1039
    "Modified: / 04-08-2011 / 20:42:10 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1042
!TestRunnerEmbedded methodsFor:'utilities'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1043
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1044
resultForSuite:suite 
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1045
    |result|
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1046
11925
7e2860fce495 use TestResultForSTX in SUnit runner
Claus Gittinger <cg@exept.de>
parents: 11600
diff changeset
  1047
    result := TestResult defaultResultClass new.
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1048
    suite tests do:[:test |
10606
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1049
        | sel cls |
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1050
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1051
        sel := test selector.
10606
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1052
        cls := test class.
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1053
        (cls testSelectorPassed:sel) ifTrue:[
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1054
            result passedOutcomes add: (cls rememberedOutcomeFor: sel)
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1055
        ] ifFalse:[
10606
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1056
            (cls testSelectorError:sel) ifTrue:[
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1057
                result errorOutcomes add:(cls rememberedOutcomeFor: sel)
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1058
            ] ifFalse:[
10606
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1059
                (cls testSelectorFailed:sel) ifTrue:[
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1060
                    result failureOutcomes add:(cls rememberedOutcomeFor: sel)
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1061
                ]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1062
            ]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1063
        ]
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1064
    ].
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1065
    ^ result
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1066
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
    "Created: / 15-03-2010 / 19:46:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1068
    "Modified: / 02-08-2011 / 18:20:00 / cg"
10606
062ab3e5fe54 sUnit fixes...
vrany
parents: 10564
diff changeset
  1069
    "Modified: / 20-08-2011 / 14:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1070
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1071
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1072
suiteForRun
12303
b93ac7ba9280 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12262
diff changeset
  1073
    | methods testMethods protocols suite selectedClass |
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
  1074
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
  1075
    selectedClass := self theSingleTestCase.
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1076
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1077
    (methods := selectedMethodsHolder value) notEmptyOrNil ifTrue:[
12303
b93ac7ba9280 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12262
diff changeset
  1078
        testMethods := self selectedTestMethods.
b93ac7ba9280 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12262
diff changeset
  1079
        suite := TestSuite named: (self suiteNameFromMethods: testMethods).
b93ac7ba9280 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12262
diff changeset
  1080
        testMethods do:[:mthd| 
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1081
            | class selector |
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
  1082
            class := selectedClass ifNil:[mthd mclass].
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1083
            suite addTest: (class asTestCase selector: mthd selector)
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1084
        ].
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1085
        ^suite
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1086
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
    
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1088
    (protocols := selectedProtocolsHolder value) isEmptyOrNil ifFalse:[
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1089
        suite := TestSuite named: (self suiteNameFromProtocols: protocols).
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1090
        (self selectedTestMethodsFromProtocols: protocols inClass:selectedClass) do:[:mthd| 
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1091
            | class selector |
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
  1092
            class := selectedClass ifNil:[mthd mclass].           
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1093
            suite addTest: (mthd mclass asTestCase selector: mthd selector)
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1094
        ].
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1095
        ^suite
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1096
    ].
10374
884c2b9cb74c Added support for inherited tests
vrany
parents: 10243
diff changeset
  1097
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
    ^self suiteForRunAll
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
    "Created: / 15-03-2010 / 13:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10454
8baf1e0c120e changed:
Claus Gittinger <cg@exept.de>
parents: 10432
diff changeset
  1101
    "Modified: / 04-08-2011 / 19:06:42 / cg"
12303
b93ac7ba9280 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12262
diff changeset
  1102
    "Modified: / 02-11-2012 / 11:17:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
suiteForRunAll
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
    |suite|
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1107
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1108
    allTestCases isNil ifTrue:[
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1109
        self updateTestCases.
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1110
    ].
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1111
    suite := TestSuite named:(self suiteNameFromClasses: self allTestCases).
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1112
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1113
    allTestCases do:[:testCase | 
10563
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1114
        suite addTests:(self buildSuiteFromClass:testCase) tests
f77d63752e6a comment/format in: #suiteForRunAll
Claus Gittinger <cg@exept.de>
parents: 10454
diff changeset
  1115
    ].
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
    ^suite
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
    "Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1119
    "Modified: / 04-06-2012 / 19:01:48 / cg"
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1120
!
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1121
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1122
suiteForRunFailed
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1123
    |suite|
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1124
11966
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1125
    suite := TestSuite named:(self suiteNameFromClasses: self allTestCases).
6040753eab24 asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents: 11925
diff changeset
  1126
    self allTestCases do:[:testCase |
11552
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1127
        (self buildSuiteFromClass:testCase) tests do:[:eachTest |
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1128
            | sel cls |
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1129
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1130
            sel := eachTest selector.
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1131
            cls := eachTest class.
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1132
            (cls testSelectorPassed:sel) ifFalse:[
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1133
                suite addTest:eachTest
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1134
            ]
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1135
        ]
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1136
    ].
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1137
    ^suite
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1138
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1139
    "Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
23bf4b9973a3 fixes and enhancements:
Claus Gittinger <cg@exept.de>
parents: 11197
diff changeset
  1140
    "Created: / 04-06-2012 / 18:32:40 / cg"
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1141
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1142
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1143
!TestRunnerEmbedded::SuiteAndResult class methodsFor:'instance creation'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1144
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1145
suite: suite result: result
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1146
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
    ^self new
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
        suite: suite;
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
        result: result.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
    "Modified: / 15-03-2010 / 15:27:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1154
!TestRunnerEmbedded::SuiteAndResult methodsFor:'accessing'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
color
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
    self testCount == 0 ifTrue:
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
        [^TestRunnerEmbedded notRunColor].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
    result ifNil:[^TestRunnerEmbedded notRunColor].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
    self hasErrors ifTrue:[^TestRunnerEmbedded errorColor].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1163
    self hasFailures ifTrue:[^TestRunnerEmbedded failedColor].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1164
    self hasPassed ifTrue:[^TestRunnerEmbedded passedColor].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
    ^TestRunnerEmbedded notRunColor
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1167
    "Created: / 15-03-2010 / 15:24:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1168
    "Modified: / 07-09-2010 / 08:25:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1169
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1170
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1171
info
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1172
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1173
    result ifNil:[^''].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1174
    (result passedCount + result failureCount + result errorCount) = 1 ifTrue:[^''].
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
    ^'%1 tests, %2 passed, %3 failed, %4 errors'
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
        bindWith: suite tests size
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1177
            with: result passedCount        
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1178
            with: result failureCount 
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1179
            with: result errorCount
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1180
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1181
    "Created: / 15-03-2010 / 20:23:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1182
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1183
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1184
name
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1185
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1186
    ^suite name
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1187
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1188
    "Created: / 15-03-2010 / 15:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1189
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1191
result
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1192
    ^ result
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1193
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1194
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1195
result:aTestResult
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1196
    result := aTestResult.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1197
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
suite
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
    ^ suite
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1202
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
suite:aTestSuite
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
    suite := aTestSuite.
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1205
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1206
10647
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1207
suiteForRun
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1208
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1209
    | suiteForRun |
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1210
    suiteForRun := suite class named: suite name.
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1211
    suiteForRun addTests:
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1212
        (suite tests collect:[:testCase|testCase class selector: testCase selector]).
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1213
    ^suiteForRun
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1214
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1215
    "Created: / 22-08-2011 / 09:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1216
!
1e9912f9a0d8 Embedded test runner no longer reuse old testcase instances
vrany
parents: 10608
diff changeset
  1217
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1218
testCount
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1219
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1220
    ^suite tests size
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1221
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1222
    "Created: / 15-03-2010 / 15:44:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1223
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1224
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
!TestRunnerEmbedded::SuiteAndResult methodsFor:'queries'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1226
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
hasErrors
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
    ^result errorCount > 0
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
    "Created: / 15-03-2010 / 15:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
hasFailures
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
    ^result failureCount > 0
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
    "Created: / 15-03-2010 / 15:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1239
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1240
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1241
hasFailuresOrErrors
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1242
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
    ^self hasErrors or:[self hasFailures]
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1244
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1245
    "Created: / 15-03-2010 / 15:45:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1246
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1247
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1248
hasPassed
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1249
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1250
    ^result passedCount > 0
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1251
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1252
    "Created: / 15-03-2010 / 22:06:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1253
! !
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1254
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1255
!TestRunnerEmbedded class methodsFor:'documentation'!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1256
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1257
version
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
  1258
    ^ '$Id: Tools__TestRunnerEmbedded.st 8076 2012-12-03 16:22:00Z vranyj1 $'
10432
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1259
!
6dc553f49d19 comment/format in: #debug
Claus Gittinger <cg@exept.de>
parents: 10431
diff changeset
  1260
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1261
version_CVS
12308
5d9291c0fc27 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12303
diff changeset
  1262
    ^ '§Header: /cvs/stx/stx/libtool/Tools__TestRunnerEmbedded.st,v 1.32 2012/11/08 00:05:16 cg Exp §'
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1263
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1264
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
  1265
version_HG
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
  1266
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12401
diff changeset
  1267
    ^ '$Changeset: <not expanded> $'
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1268
!
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1269
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1270
version_SVN
12310
bdd2106c15f5 - Tools::TestRunnerEmbedded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12309
diff changeset
  1271
    ^ '$Id: Tools__TestRunnerEmbedded.st 8076 2012-12-03 16:22:00Z vranyj1 $'
9954
aebf22e17733 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1272
! !
12604
8d8912ec9551 class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents: 12055
diff changeset
  1273