Re: Looping in Test::Harness
- From: bamccaig@xxxxxxxxx (Brandon McCaig)
- Date: Tue, 6 Apr 2010 13:24:09 -0400
On Tue, Apr 6, 2010 at 11:52 AM, Bob McConnell <rvm@xxxxxxxxx> wrote:
Is there a cleaner way to pass those variables into each test script?
I'm unfamiliar with testing practices in Perl, but I would imagine
that almost anything would be better than using environment variables
to store test values (IMO, at least). :P One potential alternative is
to pass command line arguments. I think that would be nicer than
having to configure a special environment. You could then load them
with a single line, which sure beats 5:
my ($browser, $site, $build, $user, $pwd, $fn, $ln, $usid) = @ARGV;
Couldn't you also just store the test in a subroutine and then hard
code the test values into the Perl script itself, calling the
subroutine with all of the different test data? I would imagine that
would be better...
sub my_test
{
my ($browser, $site, $build, $user, $pwd, $fn, $ln, $usid) = @_;
...
}
my_test ...;
my_test ...;
my_test ...;
my_test ...;
my_test ...;
Again, though, I'm not familiar with the testing framework you're
using (I'm brand new to Perl). >_<
.
- References:
- Looping in Test::Harness
- From: "Bob McConnell"
- Looping in Test::Harness
- Prev by Date: Re: AW: about the various styles of `open'
- Next by Date: Re: AW: Working with files of different character encodings
- Previous by thread: Re: Looping in Test::Harness
- Next by thread: about beginner perl site and developing skill
- Index(es):
Relevant Pages
|