On Wed, Apr 25, 2001 at 08:59:50PM +0100, Adam Spiers wrote:
> Matthew Astley ([EMAIL PROTECTED]) wrote:

> Any thoughts on my proposed redesign of TestSuites?  In case you
> missed it, it was posted on March 7th, subject "TestSuite inheritance
> and runner state", although for the lazy amongst you

(you're so kind 8-)

> I proposed that we ditch this
> 
>   package My::TestSuites::Foo;
> 
>   sub suite {
>     my $class = shift;
> 
>     my $suite = Test::Unit::TestSuite->empty_new('name of suite');
> 
>     use My::TestSuites::Bar;
>     $suite->add_test(My::TestSuites::Bar->suite());
> 
>     use My::TestSuites::Baz;
>     $suite->add_test(My::TestSuites::Baz->suite());
> 
>     return $suite;
>   }
> 
> in favour of
> 
>   package My::TestSuites::Foo;
>   use base qw(Test::Unit::TestSuite);
> 
>   sub name { 'name of suite' }
>   sub subsuites { qw(My::TestSuites::Bar My::TestSuites::Baz) }
> 
> which is a hell of a lot easier to read, write, and implement the
> framework for.  It also means that My::TestSuites::Bar really ISA
> TestSuite.  It never used to be, which seems rather ridiculous.

You're right, it's much better. Except, can we keep either the suite()
method or have a call to new() instead please? I do some stuff at
suite creation time. I could do it before starting the tests, but not
if the tests are started with the (Tk)?TestRunner.pl provided with
Perlunit.

Test::Unit::Suite instead of Test::Unit::TestSuite would make a lot of
sense, and shouldn't break too much stuff since it only occurs at the
top-ish levels.

Presumably there'd be defaults
 T:U::Suite::name { return ref(shift()) }
 T:U::Suite::subsuites { () }
?


Maybe we should have a client-side changelog? Listing things you'll
need to do to your test code when you upgrade to the next release.
Seems like a lot of effort though.

Maybe at least a list of obsolete identifiers... I'll stick a
placeholder in consensus.txt (not checked in yet).


Matthew  #8-)

_______________________________________________
Perlunit-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/perlunit-devel

Reply via email to