One of our test frameworks at the BBC has difficulties using TODO testing due 
to the declarative nature of the tests being written in YAML.  There is now a 
patch in RT (http://rt.cpan.org/Ticket/Display.html?id=38018) with allows us 
fine-grained control over TODO tests.  It basically lets us do things like this:

  my $builder = Test::Builder->new;

  foreach my $test_case ($framework->cases) {
      if ( my $message = $test_case->todo ) {
          $builder->start_todo($message);
          $test_case->run;
          $builder->end_todo;
      }
      else {
          $test_case->run;
      }
  }

Going through our test framework and wrapping every possible test in an 
optional TODO is rather problematic, but trying to use a fully-qualified $TODO 
package variable (as documented in Test::Builder) is equally problematic as 
there are many packages, not all of which we know in advance.  This allows us 
easily to mark as 'TODO' entire test cases.

We're implementing this today because lack of a feature like this is causing us 
much grief.

(As a needed side-effect, you can now nest TODO tests with this syntax).

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

Reply via email to