Hi Michael!
Thanks for your commentary.
On Monday 10 October 2005 23:27, Michael G Schwern wrote:
> On Mon, Oct 10, 2005 at 10:53:34PM +0200, Shlomi Fish wrote:
> > Let me know what you think.
>
> $ perl -Ilib -wle 'use Test::Shlomif::Harness::Obj;
> Test::Shlomif::Harness::Obj->new->runtests(test_files => [EMAIL PROTECTED])'
> t/*.t
> Can't use an undefined value as an ARRAY reference at
> lib/Test/Shlomif/Harness/Obj.pm line 715.
>
> runtests() is not doing anything with its arguments and neither is
> _run_all_tests() so $self->test_files is undefined.
It was a documentation problem. The current syntax is:
<<<<
my $tester = Test::Shlomif::Harness::Obj->new(
'test_files' => [EMAIL PROTECTED],
);
$tester->runtests();
>>>>
> In fact, there's a
> few places where you code waffles between getting information from the
> object and from its arguments. _leader_width, for example, gets its
> test_files from its arguments even though it should be available on the
> object.
Yes, I initially thought it might be a good idea to make it able to calculate
the width of other test file collections except its own. But since it's a
private method (that has a leading underscore), then I guess I can avoid it.
>
> Moving along, here's what happens on a simple test failure.
>
> $ perl -Ilib -wle 'use Test::Shlomif::Harness::Obj; $t =
> Test::Shlomif::Harness::Obj->new; $t->test_files([EMAIL PROTECTED]);
> $t->runtests()'
> t/fail.t t/fail....NOK 1 # Failed test in t/fail.t at line 4.
> # Looks like you failed 1 test of 1.
> t/fail....dubious
> Test returned status 1 (wstat 256, 0x100)
> DIED.
> Undefined format "STDOUT" called at lib/Test/Shlomif/Harness/Obj.pm line
> 842.
>
> It appears all that nasty format code that we hate in Test::Harness has
> gone missing yet _fail_other() still tries to use it.
>
Fixed now. I first restored the formats, then gradually refactored the code to
eliminate them.
Available now as:
http://download.berlios.de/web-cpan/Test-Shlomif-Harness-0.0100_03.tar.gz
>
> The way you've broken down the nattier bits of Test::Harness, such as
> _show_results(), into digestable functions has value.
> I'd like to see
> that sort of thing as patches to Test::Harness rather than in a fork.
Well, I started with Test::Harness and gradually revamped it. The problem is
that some aspects of the T::H interface suck, and I had to change the
interface in a non-backwards-compatible way.
Thanks again.
Regards,
Shlomi Fish
> Also using an object *internally* makes sense. Cleans up having to pass
> %tot and %test around all over. An external object interface will require
> a lot more thought.
>
>
> --
> Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
> Ahh email, my old friend. Do you know that revenge is a dish that is best
> served cold? And it is very cold on the Internet!
--
---------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Homepage: http://www.shlomifish.org/
95% of the programmers consider 95% of the code they did not write, in the
bottom 5%.