James E Keenan wrote:


I would like to be able to provide the tests run via 'prove' with options something like this:

  some_variant_of_prove t/*.t --option1 --option2 arg1 arg2

... where those 4 command-line options/arguments would be available to *each* of the individual test files in the suite. A given test file would not necessarily have to respond to those options/arguments, but if it wanted to, it would do so simply by assigning the contents of the test script's @ARGV to some other array.

Can this be done?


And, thanks to the contributors to this list, it was done. This has been supported since Test-Harness-3.04 and assumed its current version -- with the 'arisdottle' :: character announcing the beginning of arguments to be passed the test files -- in 3.05.

I have begun to make use of this in a Perl 5 module in the Parrot distribution which governs the running of tests of configuration step classes: http://svn.perl.org/parrot/branches/tcif/lib/Parrot/Configure/Options/Test.pm at r26081. This is a work-in-progress, but this was exactly the reason why I put out the call for passing of test arguments in my OP to this thread.

My thanks to Andy Armstrong and all others who contributed to this development, which will open up new approaches to testing with Perl.

(I am recommending one refinement in the App::Prove code underlying this version of 'prove'. See: http://rt.cpan.org/Ticket/Display.html?id=33609.)

Thank you very much.

Jim Keenan

Reply via email to