[ENH] Hierarchical TestRunner (was: Re: [ENH] TestRunner
with a sorted list of classes)
Rob Withers
rwithers12 at mediaone.net
Sun Jan 20 20:05:28 UTC 2002
Hi all,
my chump change..
[HierarchyTestRunner]
I think my HierarchicalTestRunner is pretty straight forward and
useful. This is especially true of the double-click behavior. I _really_
like TestViaMethod for those simple tests on many core classes. I have
many tests that I want to switch to use this mechanism. It seems to have a
limitation on how complex a test you are able to write. Tests with lots of
fixtures and with lots of assertions, may not fit this model, but I'm not
sure.
For those classes of tests which need more fixture creation and
assertions, we should perhaps put them in a hierarchy based on
subsystem. Then it would be easy to navigate to your tests. Note that if
you select an abstract test case, then it will run all tests contained in
that inheritance hierarchy.
[Henrik's common selector prunings]
Henrik, I do like the reorganization you have done. It is _much_ less
splat. However, two things. First is that the whole point of this
framework is to provide for cross-dialect TestCases. Since this is the
Core framework, you have changed, and not just a access method in the View,
you are now forking quite radically from the published framework. I think
this is a bad thing to do. Secondly, I believe that some work was
undertaken, by Sames of SUnit and the larger Camp Smalltalk communitee, to
define a common PlatformCompatability class, which would provide platform
specific details to doing reflection, evaluation and exceptions, through a
common protocol. I am not sure of the status of this work, but you should
show them your ideas of refactoring these calls. I don't think it is a
very good idea to reduce this splat until the next version of SUnit comes
out to address this, due to the first objection.
[TestRunner test sorting]
I looked into my changeset again and I also provided for the
normal TestRunner to sort test names. If fact, this is how I got onto
organizing it hierarchically. Here are the two versions, mine, then
Benoit's. I don't care which one is used.
gatherTestNames
| theNames |
theNames _ (TestCase allSubclasses collect: [:each | each name])
asOrderedCollection.
theNames remove: #TestViaMethodCall ifAbsent: [^ theNames].
TestViaMethodCall addClassesTo: theNames.
^ theNames sortBy: [:a :b | a < b]
gatherTestNames
| theNames |
theNames _ (TestCase allSubclasses
collect: [:each | each name])
asSortedCollection asOrderedCollection.
theNames
remove: #TestViaMethodCall
ifAbsent: [^ theNames].
TestViaMethodCall addClassesTo: theNames.
^ theNames
cheers,
Rob
At 05:26 AM 1/20/2002, ducasse wrote:
>Hi rob, benoit and henrik
>
>You are three that submitted changes to SUnit recently. Could you
>resynchronize and propose one change set where all of you agree? may be
>create project in the Squeak foundation page. This would help the process of
>gatehrting changes.
>
>I tried to understand what Henirk made but there was lot of changes and I
>could not really see if this was needed (I prefered to look at small changes
>instead, I had really few moments to help harvesting).
>
>Stef
>
>
>
>on 20/01/02 7:34 AM, Rob Withers at rwithers12 at mediaone.net wrote:
>
> > Benoit, Did you see the HeirarchicalTestRunner changeset I posted
> > before? It includes sorting the list, as well as double-click
> > browse. Here it is a slightly newer version. Just doIt to:
> >
> > HierarchicalTestRunner open.
> >
> > cheers,
> > Rob
> >
> > At 01:01 AM 1/20/2002, Benoit St-Jean wrote:
> >> Displays the test classes of TestRunner (SUnit) in
> >> alphabetical order. FileOut attached.
> >>
> >> =====
> >> -------------------------
> >> Benoit St-Jean
> >> bstjean at yahoo.com
> >> Yahoo! Messenger: bstjean
> >> http://cactus.swiki.net
> >> -------------------------
> >>
> >> __________________________________________________
> >> Do You Yahoo!?
> >> Send FREE video emails in Yahoo! Mail!
> >> http://promo.yahoo.com/videomail/
> >
More information about the Squeak-dev
mailing list
|