From 96e5d85741095cb45602b05df8514c630f821cb9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 15 Apr 2010 13:01:37 +0200 Subject: [PATCH 1/4] SUnit: Initialize errors, failures and passed in the initialize method This is needed to help merging the Pharo changes on SUnit as the passed and errors selector were redefined to collect the information from two other selectors. --- packages/sunit/SUnit.st | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/sunit/SUnit.st b/packages/sunit/SUnit.st index e21e9ca..004627e 100644 --- a/packages/sunit/SUnit.st +++ b/packages/sunit/SUnit.st @@ -300,7 +300,6 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i errors [ - errors isNil ifTrue: [errors := Set new]. ^errors ] @@ -311,13 +310,11 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i failures [ - failures isNil ifTrue: [failures := Set new]. ^failures ] passed [ - passed isNil ifTrue: [passed := OrderedCollection new]. ^passed ] @@ -334,9 +331,9 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i tests [ ^(OrderedCollection new: self runCount) - addAll: self passed; - addAll: self errors; - addAll: self failures; + addAll: passed; + addAll: errors; + addAll: failures; yourself ] @@ -372,7 +369,9 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i initialize [ - + errors := Set new. + failures := Set new. + passed := OrderedCollection new. ] runCase: aTestCase [ @@ -385,16 +384,16 @@ This is a Collecting Parameter for the running of a bunch of tests. TestResult i true] sunitOn: self class failure do: [:signal | - self failures add: aTestCase. + failures add: aTestCase. signal sunitExitWith: false]] sunitOn: self class error do: [:signal | - (self errors includes: aTestCase) ifFalse: [aTestCase logError: signal]. - self errors add: aTestCase. + (errors includes: aTestCase) ifFalse: [aTestCase logError: signal]. + errors add: aTestCase. signal sunitExitWith: false]. aTestCase logPolicy flush. - testCasePassed ifTrue: [self passed add: aTestCase] + testCasePassed ifTrue: [passed add: aTestCase] ] printOn: aStream [ -- 1.7.0