SUnit: Skipping tests?

stéphane ducasse ducasse at iam.unibe.ch
Tue Mar 28 08:14:15 UTC 2006


> I find it rather cool to be able to put tests anywhere I want:

I missed that point. You do not have to write tests in TestCase classes?

Can you explain that? We can define tests anywhere because
of the @ usage?

> In
> Magritte/Pier I was forced to duplicate most of the model hierarchy
> for the test-cases (some tests are designed to run on whole
> hierarchies), what is rather annoying to maintain. Being able to put
> the tests anywhere would make it much easier to navigate, browse and
> maintain the tests.
>
> I think the way JUnit is doing the tests is simpler than the one of
> SUnit, naming conventions and declarations are rather difficult to
> understand. Basically JUnit know 3 different kinds of annotations,
> translated to Smalltalk this would look like:
>
> - test-methods can be implemented anywhere in the system and are taged
> with the annotation <test>.

I guess only if you have a test without setup.
>
> - setUp- and tearDown-methods can be implemented anywhere in the
> system and are taged with the annotation <setUp> and <tearDown>.
>
> - resources are being implemented anywhere in the system and are taged
> with the annotation <begin> and <end> (it took me 3 years to
> understand how resources work in the current implementation).

And there are not really satisfactory since you cannot control when
they are exactly setup. I wanted to have tests that shared all the
same setup that is run only one for all the tests.

> Of course one could implement a facade to make the tests run the old
> way. And subclassing TestCase would still work, for those tests that
> need a more complex object setup for the tests.

I do not know but indeed rethinking SUnit based on the need we have  
would be good.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>




More information about the Squeak-dev mailing list