On 12/15/05, Troy Denkinger <[EMAIL PROTECTED]> wrote:
>
>
> I wrote a test harness - you'll find the code below my signature, if
> you're interested.  When I run it, I get the following:
>
> You said to run 0 tests!  You've got to run something.
> # Looks like your test died before it could output anything.
>
> Then the tests run and the success/failure report for each module
> returns success.  Anyone have any idea where this error is coming from?


That's an error from Test::Builder (ie. the thing behind Test::More and
others) and not Test::Harness.  Its coming from the test program your
harness is running, not from the harness itself.

 My guess would be is that the recursive search for test files (using
File::Find and looking for .t files it not the same as t/*.t) has picked up
a .t file you forgot about somewhere inside your t/ directory hierarchy and
is trying to run it.  Additionally, File::Find will chdir() into each
directory as it works, thus you're running your tests from a different place
than prove.  Most tests assume they're being run from the top of the package
source directory, not from their own directory.  If your plan is based on
reading some list of files in the source directory it probably can't and
thus is coming up with 0.  You can use the 'no_chdir' flag to get around
this.

Simplest thing to do is to throw in a print $File::Find::name before your
analyze_file() call so you can know what messages are associated with what
test files, that should allow you to easily identify the failing test.  And
you really should have that sort of information in your harness anyway.
Also throw in a cwd() check to verify that File::Find has put you in an odd
directory.

Reply via email to