Re: Looping in Test::Harness



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). >_<
.



Relevant Pages

  • Re: Environment veriable
    ... Perl should inherit whatever the environment shell it is called in. ... UNIX) concerning environment variables. ... It should unless the batch file commands prior to it span a new ...
    (perl.beginners)
  • Re: unsetenv in the shell
    ... i have a perl program that calls another application. ... application uses the value of certain environment variables during its ... system("unsetenv VAR1"); ... in a perl script. ...
    (comp.lang.perl.misc)
  • Re: AGAIN: how can I install modules if Im not root?
    ... claim that environment variables are bad ... won't screw one if one has multiple versions of Perl. ... install would work for a user by installing to a personal directory for them. ... additional modification of scripts using this module and/or scripts ...
    (comp.lang.perl.moderated)
  • Re: Environment veriable
    ... Jack Faley wrote: ... >>> variables in the batch file and have it call perl. ... > interested to know if you listed you environment variables before calling perl ...
    (perl.beginners)
  • Re: need help in solving error in perl
    ... Imagine you had done a search before you posted. ... guessing you downloaded binary packages of Perl and of DBD::Sybase ...
    (comp.lang.perl.misc)