(For those those who missed the initial conversation, a deferred plan
is like 'no_plan' except the developer specifies the number of tests at
the end of the run instead of Test::Builder just listing how many tests
have run.)

Once again I find that deferred plans would be very helpful.  I have a
test runner which runs tests defined in a declarative style in YAML
files.  The YAML files specify their plan.  *However*, the test runner
looks something like this:

  use Test::More 'no_plan';
  use TestRunner;
  TestRunner->run(
    $yaml,
    $optional_callback
  );

This optional callback sometimes does setup work which itself has
tests.  So the YAML file won't know about tests defined outside of
itself and I don't know how many tests are in the YAML file until after
it's already loaded and run.

Sure, I could rewrite our entire testing system to work around this
problem, but this would take a lot of time.  I want to do this:

  use Test::More 'deferred';
  use TestRunner;
  my $tests_run = TestRunner->run(
    $yaml,
    $optional_callback
  );
  plan $tests_run;

(It also sucks when I have multiple YAML files, each of which has its
own plan.  This makes the probleme even harder)

Schwern, will you accept a patch which allows deferred plans?

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog     - http://use.perl.org/~Ovid/journal/

Reply via email to