[Question] SUnit 2.7 and Squeak: how do you structure test

Robert Hirschfeld hirschfeld at acm.org
Wed Jul 5 06:07:32 UTC 2000


Piero,

In the 2.8 port of SUnit you can limit the test cases executed by
providing selection patterns for the subclasses of TestCase and
their test methods.

For instance, if one of your projects uses a classname prefix,
say 'Xxx', to simulate a namespace, you can use this prefix to 
select those classes via

  [TestRunner new runTests: 'Xxx*']

To narrow down the set of tests further, you can add
another selection pattern for the names of actual test methods
to be run like all test methods that end in 'Yyy':

  TestRunner new runTests: 'Xxx* test*Yyy'

More convenient though is the use of the TestModel (open it with

  TestModel openAsMorph

in a morphic environment, or with

  TestModel open

in a MVC environment. The mechanism to select specific tests is the
same.

-Robert


Piero Campanelli wrote:
> 
> Hi,
> 
> I have used JUnit with VisualAge Java and i have founded the integration
> with the IDE very useful. Now i am working with Squeak but I see there is no
> integration:
> 
> - TESTRUNNER search for all TestCases classes and fill a list widget. It
> isn't useful if my project has 750 TestCases :). Isn't it ?
> 
> - If I want to run all test cases at once i have to do this:
> 
>     t := TestSuite new.
>     t addTest: ClassOneTest suite.
>     t addTest: ClassTwoTest suite.
>     t addTest: ClassThreeTest suite.
>     ............
>     (t run) inspect
> 
> My question is:
> could I extend TestRunner so it runs a predefined list of TestCases or is
> there someone who is just working on it ?
> 
> Sorry, probably this is the right mailing list...
> Tnx
> Piero

___________________________________________
                          Robert Hirschfeld
                  mailto:hirschfeld at acm.org
   http://www.prakinf.tu-ilmenau.de/~hirsch





More information about the Squeak-dev mailing list