--- Andrew Savige <[EMAIL PROTECTED]> wrote:
> Fergal Daly wrote on 14 July 2003:
> > 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.
>
> Which module is this? What did you end up doing? I'm interested to study
> what you did, so as to learn new testing techniques.
I do something like the following to get this effect:
#!/usr/bin/perl -w
use strict;
use Test::Harness;
use Getopt::Long;
use Pod::Usage;
GetOptions(
'help|?' => sub { pod2usage(-verbose => 2); exit },
'verbose!' => \$Test::Harness::verbose,
'quiet' => sub { $Test::Harness::verbose = 0 },
'include=s' => \my @include,
'exclude=s' => \my @exclude,
'shuffle' => \my $shuffle_tests,
'fast' => \$ENV{FAST_TESTS},
);
In this case, this is part of my driver script and I call it like:
grind --fast
That runs through all of my tests, but the "FAST_TESTS" environment variable is
available in the
test programs that I run.
Cheers,
Ovid
=====
Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm
Ovid http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com