On Tue, 12 Apr 2005, Paul Johnson wrote:

> I would do it in the same way as if this had nothing to do with tests.
> That is, abstract away the common code into a module, which can also
> live under t/

That would be a lot of work in this case.  I found an easier
solution.  In tweek-then-foo.t:

  {
     local $ENV{SUB_TEST} = 1;
     do 't/foo.t' or die ...;
  }

And in foo.t, replacing the usual Test::More use line:

  BEGIN {
    unless ($ENV{SUB_TEST}) {
        eval "use Test::More qw(no_plan);";
        die $@ if $@;
    }
  }

Seems to work fine so far, and it definitely is a lot easier than
trying to modularize a rather hairy foo.t.

-sam

Reply via email to