Levente Uzonyi uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-ul.73.mcz==================== Summary ====================
Name: SUnit-ul.73
Author: ul
Time: 15 December 2009, 1:07:18 am
UUID: f2fd81c0-d605-7246-8513-b6167b9d2c2b
Ancestors: SUnit-ul.72
- refactored LongTestCase
- added a preference for running long test cases
=============== Diff against SUnit-ul.72 ===============
Item was changed:
----- Method: LongTestCase class>>doNotRunLongTestCases (in category 'accessing') -----
doNotRunLongTestCases
+ self shouldRun: false!
- DoNotRunLongTestCases := true.!
Item was changed:
----- Method: LongTestCase class>>runLongTestCases (in category 'accessing') -----
runLongTestCases
+ self shouldRun: true!
- DoNotRunLongTestCases := false.!
Item was changed:
----- Method: LongTestCase class>>buildSuite (in category 'instance creation') -----
buildSuite
+
| suite |
suite := TestSuite new.
+ self shouldRun ifTrue: [
- DoNotRunLongTestCases ifFalse: [
self addToSuiteFromSelectors: suite].
^suite!
Item was changed:
TestCase subclass: #LongTestCase
instanceVariableNames: ''
+ classVariableNames: 'ShouldRun'
- classVariableNames: 'DoNotRunLongTestCases'
poolDictionaries: ''
category: 'SUnit-Extensions'!
+
+ !LongTestCase commentStamp: 'ul 12/15/2009 13:06' prior: 0!
+ A LongTestCase is a TestCase that usually takes a long time to run. Because of this users can decide if they want to execute these or not, by changing the "Run long test cases" preference.!
Item was added:
+ ----- Method: LongTestCase class>>shouldRun (in category 'accessing') -----
+ shouldRun
+
+ <preference: 'Run long test cases'
+ category: 'SUnit'
+ description: 'If true, the tests defined in subclasses of LongTestCase will run, if they are selected in the Test Runner, otherwise not. As the name suggests, running these tests can take a long time.'
+ type: #Boolean>
+ ^ShouldRun ifNil: [ false ]!
Item was changed:
----- Method: LongTestCase class>>allTestSelectors (in category 'accessing') -----
allTestSelectors
+
+ self shouldRun ifTrue: [
+ ^super testSelectors ].
- DoNotRunLongTestCases ifFalse: [
- ^super testSelectors].
^#().!
Item was added:
+ ----- Method: LongTestCase class>>shouldRun: (in category 'accessing') -----
+ shouldRun: aBoolean
+
+ ShouldRun := aBoolean!
Item was removed:
- ----- Method: LongTestCase class>>initialize (in category 'initialization') -----
- initialize
-
- self doNotRunLongTestCases!