--- a/RegressionTests__CompilerTest.st Sat Feb 05 11:40:00 2011 +0100
+++ b/RegressionTests__CompilerTest.st Tue May 03 16:53:36 2011 +0200
@@ -16,6 +16,30 @@
privateIn:CompilerTest
!
+Object subclass:#Schedule
+ instanceVariableNames:'state'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:CompilerTest
+!
+
+Object subclass:#State
+ instanceVariableNames:'state'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:CompilerTest::Schedule
+!
+
+
+!CompilerTest class methodsFor:'helpers'!
+
+compile:code
+ Error handle:[:ex |
+ ^ #Error
+ ] do:[
+ ^ super compile:code
+ ]
+! !
!CompilerTest class methodsFor:'others'!
@@ -275,6 +299,7 @@
!CompilerTest methodsFor:'others'!
+
foo:arg
^ arg
ifTrue:[1]
@@ -2172,6 +2197,46 @@
"Created: / 24-08-2010 / 12:51:27 / cg"
! !
+!CompilerTest methodsFor:'tests - stc compilation'!
+
+testCodeForMethodVarAccess
+ "compile this with stc - some gcc versions generate wrong code for it (result is nil)"
+
+ |results renderNone allSchedules overallCount passedCount inconclusiveCount failedCount|
+
+ self x_executeBlock:[
+ |localResults localPassedCount localInconclusiveCount|
+
+ allSchedules := self x_generateSchedules.
+
+ overallCount := allSchedules size.
+ (renderNone := (overallCount == 0)) ifFalse:[
+ results := allSchedules collect:[:ts | ts getStateOfLastRun].
+
+ passedCount := results count:[:state | state isSuccess].
+ inconclusiveCount := results count:[:state | state isInconclusive].
+
+ failedCount := overallCount - passedCount - inconclusiveCount.
+ ]
+ ].
+!
+
+x_executeBlock:aBlock
+ aBlock value
+!
+
+x_generateSchedules
+ ^ OrderedCollection
+ with:(Schedule new state:#failed)
+ with:(Schedule new state:#passed)
+ with:(Schedule new state:#passed)
+ with:(Schedule new state:#failed)
+ with:(Schedule new state:#inconclusive)
+ with:(Schedule new state:#inconclusive)
+ with:(Schedule new state:#inconclusive)
+ with:(Schedule new state:#failed)
+! !
+
!CompilerTest::DummyClass methodsFor:'accessing'!
_y0
@@ -2190,6 +2255,36 @@
request := something.
! !
+!CompilerTest::Schedule methodsFor:'accessing'!
+
+getStateOfLastRun
+ ^ State new state:state
+!
+
+state:aSymbol
+ state := aSymbol
+! !
+
+!CompilerTest::Schedule::State methodsFor:'accessing'!
+
+state
+ ^ state
+!
+
+state:something
+ state := something.
+! !
+
+!CompilerTest::Schedule::State methodsFor:'queries'!
+
+isInconclusive
+ ^ state == #inconclusive
+!
+
+isSuccess
+ ^ state == #passed
+! !
+
!CompilerTest class methodsFor:'documentation'!
version