Code coverage

Diego Fernandez diegof79 at gmail.com
Tue Jan 17 14:12:51 UTC 2006


Thanks Lucas, I will try it.
Yesterday I started to do the code coverage tool using "method wrappers", it
worked :)

But my unit tests of the coverage tool some times fails and some times pass
(I think that is caused by some initialization made by the method wrappers).
Anyway.. I think that tomorrow I'm going to upload the first version of the
package to SqueakMap.

On 1/17/06, Lukas Renggli <renggli at gmail.com> wrote:
>
> > Hi, is there any tool to do code coverage? (at method level is enough, i
> > want to do something to check that unit test cover all the methods)
>
> You might want to try something like that in any Squeak image:
>
> tallies := IdentityDictionary new.
> prev := [ MAFileModelTest suite run ].
> thisContext sender
>         runSimulated: prev
>         contextAtEachStep: [ :curr |
>                 curr == prev ifFalse: [
>                         (tallies
>                                 at: curr receiver
>                                 ifAbsentPut: [ Set new ])
>                                         add: curr selector ].
>                         prev := curr ] ].
>
> There are some bugs in the simulator that prevent you from running
> tests  that containing #should:raise: and #shouldnt:raise:, else this
> technique works very well and requires no additional package.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060117/6bb5ee7c/attachment.htm


More information about the Squeak-dev mailing list