Fergal Daly wrote:
> Hi,
> is it possible with Test::Harness and MakeMaker to pass arguments
> to my test scripts? I think it's not but I just want to check for sure.
> The module I'm working on is getting a new "optimised" mode so I'd like
> to be able to run all the tests twice, once with and once without the
> optimiser.
I have a similar problem; I'd like some of my test programs
to generate other test programs on the fly, then run them.
This seems to work:
use strict;
use Test::Harness;
my $outf = 'out.tmp';
print "1..1\n";
local *SAVOUT; open(SAVOUT, ">&STDOUT"); # save original STDOUT
open(STDOUT, '>'.$outf) or die "error: open '$outf': $!";
my $success = runtests('t/some_generated_test.t');
open(STDOUT, ">&SAVOUT"); # restore STDOUT
$success or print "not ";
print "ok 1\n";
but I feel odd. Or should I generate them in Makefile.PL?
Does anyone know of a CPAN module that generates its test programs?
More generally, which CPAN modules have particularly good test
suites, worthy of study?
/-\
http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.