joewoodhouse30 has asked for the wisdom of the Perl Monks concerning the following question:
I maintain an automation tool that basically runs standard Perl test scripts (TAP using Test::More). At the start of each script, the same operation is performed which is to connect to a set of servers that will be the target of the test. Basically something like this
Im wondering if using Test::TAP::Model I can pass things to my test scripts - it seems impossible as I read the source. Basically what I want to do isuse Test::More; use ServerConnection; my $connection = ServerConnection->new(); $connection->connect(); ok( 1==1, "A test"); # etc....
# In the launch script my $connectionObject = ConnectionObject->new(); $connectionObject->connect(); my $model = Test::TAP::Model->new(); $model->run_tests( $connectionObject, @scripts_ptest );
Rather than doing the connection stuff at the top of each script (and wasting lots of time). So, as I probably should have said at the start, I want to re-use the same object across many different test scripts (I don't think it can be serialised as it contains ssh connections). Anyone have any ideas?
Many thanks, hope that made an ouce of sense! Joe
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Test::TAP::Model and a global object
by skx (Parson) on Oct 16, 2007 at 08:46 UTC | |
by joewoodhouse30 (Novice) on Oct 16, 2007 at 09:23 UTC | |
by skx (Parson) on Oct 16, 2007 at 10:33 UTC |