Bug in prove exit status

Ovid curtis_ovid_poe at yahoo.com
Thu Sep 4 10:21:06 UTC 2008


Here's the test:

  use Test::More tests => 2;

  TODO: {
      local $TODO = 'has_problems, buddy!';
      ok 1;
      ok 0;
  }

And let's run it:

  $ prove todo.t; echo $?
  todo.t .. ok   
  All tests successful.

  Test Summary Report
  -------------------
  todo.t (Wstat: 0 Tests: 2 Failed: 0)
    TODO passed:   1
  Files=1, Tests=2,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.00 csys =  0.06 CPU)
  Result: PASS
  1

As you can see, we have a '1' as the value of $? and that's causing our integration tests to fail.  The problem is that App::Prove::_runtests is returning the value of $aggregator->has_problems.  I think it should return $aggregator->has_errors, but if there's a rationale behind this that I'm not aware of, I'd like to know before I fix this.

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6


More information about the tapx-dev mailing list