chromatic wrote:
> On Wednesday 05 September 2007 09:45:53 Andy Dougherty wrote:

> 
> That looks reasonable, but why does the code use prove in the first
place, and 
> not Test::Harness::runtests()?
> 

And why not?

>From 'perldoc Test::Harness':

"STOP! If all you want to do is write a test script, consider using
Test::Simple."

... and ...

"The prove utility is a thin wrapper around Test::Harness."

>From these I infer:  (1) Cet. par., use Test::Simple or Test::More.  (2)
 When that's not appropriate, use 'prove'.

At YAPC::NA::2004 in Buffalo, Andy Lester gave a lightning talk which
boiled down to:  "Use 'prove'."

Naturally, I did what Andy told me.

I've done a lot of testing since then, have written a lot of tests, and
have given talks on my adventures in testing.  In each of those talks I
have repeated the message:  use 'prove'.

No one has ever contradicted me on that.  In particular, no one has ever
said, "You should be using Test::Harness::runtests() instead."  In fact,
until I ran the perldoc just now, I mostly associated runtests() with
discussion of the upcoming Test::Harness 3.0 on the qa list.

And since, at particle's request
(http://rt.perl.org/rt3/Ticket/Display.html?id=42690), I added the
--test option(s) back in May, they've always run on 'prove'.  Until
today, no one complained.

Of course, the other Andy (or one of the other Andys) -- Andy Dougherty
-- has the knack of finding bugs in my tests that no one else does.  So
I'll give his patch serious consideration.

But if you think Test::Harness::runtests() is superior to 'prove' in
this case ... well, as the first Andy would say, "Patches welcome."

kid51



Reply via email to