[tapx-dev] Test::Harness 3.0

Andy Armstrong andy at hexten.net
Mon Jul 23 17:39:04 BST 2007


On 23 Jul 2007, at 17:17, Andy Dougherty wrote:
> Here's the countingbug.t test script.
>
> #!/usr/bin/perl -wT
>
> use strict;
>
> use lib 'lib';
> use TAP::Base;

What are those for ^^^^^

> use Test::More tests => 6;
> ok(1);
> ok(0);
> ok(0);
> ok(0);
> die("unexpected crash!");
> ok(5);
> ok(6);

I see the problem. This isn't a test /of/ TAP::Parser - it's just a test
that fails under Test::Harness. So when you run the TAP::Parser test
suite under Test::Harness as per your example you see the T::H bug.
You're not testing TAP::Parser at all.

As Ovid said if you actually run your test using runtests you get

     [17:34] andy $ runtests -v andy/countingbug.t
     andy/countingbug......
     1..6
     ok 1
     not ok 2

     #   Failed test at andy/countingbug.t line 10.
     not ok 3
     not ok 4

     #   Failed test at andy/countingbug.t line 11.

     #   Failed test at andy/countingbug.t line 12.
     unexpected crash! at andy/countingbug.t line 13.
     # Looks like you planned 6 tests but only ran 4.
     # Looks like you failed 3 tests of 4 run.
     # Looks like your test died just after 4.
     Dubious, test returned 255 (wstat 65280, 0xff00)
     Failed 5/6 subtests

     Test Summary Report
     -------------------
     andy/countingbug.t (Wstat: 65280 Tests: 4 Failed: 3)
       Failed tests:  2-4
       Non-zero exit status: 255
       Parse errors: Bad plan.  You planned 6 tests but ran 4.
     Files=1, Tests=4,  1 wallclock secs ( 0.02 cusr +  0.01 csys =   
0.03 CPU)
     voodoo:~/Works/Perl/TAPx-Parser/tapx/trunk

Which looks pretty reasonable to me.

-- 
Andy Armstrong, hexten.net



More information about the tapx-dev mailing list