shree has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have written some test scripts using the module Test::More, But now I want to run those test scripts with Test::Harness;
Here the problem is that I need to pass an option with each test scripts. For example: perl testSctipt1.t -d 20100419.
use strict; use warnings; use Test::Harness; my @tests = ("testScript1 -d 20091201", "testScript2.t -d 20091211"); runtests(@tests);

Here I get ERROR like
Cannot detect source of 't/parse_df_a.t -a 2009120106050016'! at /usr/bin//perl5.10.0/lib/5.10.0/TAP/Parser/IteratorFactory.pm line 263 TAP::Parser::IteratorFactory::detect_source('TAP::Parser::IteratorFactory=HASH(0xb38cf0)', 'TAP::Parser::Source=HASH(0xb427c8)') called at /usr/bin/perl5.10.0/lib/5.10.0/TAP/Parser/IteratorFactory.pm line 213
And I knew that this is because that, I am passing the an option with the each test scripts and due to this I am getting such Error.
So please let me know any one how can i run the test scripts with Harness by passing some values with each test scripts.

Replies are listed 'Best First'.
Re: using Test::Harness
by choroba (Cardinal) on Apr 19, 2010 at 12:26 UTC
    For each test, create a temporary script that calls it with the given parameter. Then run these temp scripts from runtests rather then the tests themselves.
      Yes, I can do this way but here I need to write again the number of temp scripts which runs the each test script right? Is there any other way .... ...... ..... ?