[squeak-dev] Release candidate Squeak4.4-12319 Test Results Cog OSX

Colin Putney colin at wiresong.com
Thu Dec 20 07:39:41 UTC 2012


On Thu, Dec 20, 2012 at 2:08 AM, Frank Shearar <frank.shearar at gmail.com>wrote:

> So I tried an experiment last night where I manually re-added
> MCMockClassA >> #one, which failed dismally. Would adding
> "MCMockPackageInfo initialize" be the right thing to do in MCTestCase
> >> #tearDown? (That seems kind've strange; I don't see why that would
> re-add a deleted method, for instance. Unless initialising wiped out
> local changes... I'll try this out on the train to work today.)
>

It just needs to be executed before the image is shipped. The problem is
that PackageInfo class>>named: used to find PackageInfo subclasses, back
when the MC tests were written. Then the behaviour of PackageInfo was
changed, so that PackageInfo subclasses have to register themselves during
class initialization. But since MC was already in the base image, the class
initialize method for MCMockPackageInfo was never called.

As a result, the 'MonticelloMocks' package that the MC tests use is a
vanilla PackageInfo instance, which is empty. That leads to the
MCSnapshotResource for a test run being empty, which causes #tearDown
methods to fail to restore the mocks after a test that alters them. That's
why #one is missing.

Ultimately, this isn't a problem in the code, it's in the state of the
image. All you have to do is execute "MCMockPackageInfo initialize"
*before* running the tests, and everything works fine. Add it to
ReleaseBuilder so that the image will ship with a properly initialized
mocks package.

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121220/c1207106/attachment.htm


More information about the Squeak-dev mailing list