Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 2590
Status: rejected
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: frag [...] ripco.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 2.28
Fixed in: (no value)



Subject: Enable test files to have arguments
I'm in a situation where I need to do the following: my @tests; #... push @tests, "test_bundle.t 105"; push @tests, "test_bundle.t 106"; #... etc. runtests(@tests); Because there is no literal file "test_bundle.t 105", this dies. The problem seems to be that Straps::analyze_file($test) simply tests for '-e $test' and '-r $test'. It would be great if it could parse up the $test before doing these tests. If not by default, then perhaps some configurable instance variable could control this, with the current behavior as default.
[guest - Fri May 16 11:11:56 2003]: Show quoted text
> push @tests, "test_bundle.t 105"; > push @tests, "test_bundle.t 106"; > #... etc. > runtests(@tests);
A work around is to instead write a data file which your tests then read. Show quoted text
> Because there is no literal file "test_bundle.t 105", this dies. > The problem seems to be that Straps::analyze_file($test) simply tests > for '-e $test' and '-r $test'. > > It would be great if it could parse up the $test before doing these > tests. If not by default, then perhaps some configurable instance > variable could control this, with the current behavior as default.
I don't think this can be wedged into the runtests() interface (the heuristic you suggest above is Fraught With Peril, people do put spaces in filenames) but it could be added to Test::Harness::Straps->analyze_file() easily. $strap->analyze_file($file, @args); And with some work you can do it with analyze_fh() already. All this is not particulary useful until we cleanup the Test::Harness display code into an object like we did with the parsing code.
[guest - Fri May 16 11:11:56 2003]: Show quoted text
> I'm in a situation where I need to do the following: > > my @tests; > #... > push @tests, "test_bundle.t 105"; > push @tests, "test_bundle.t 106"; > #... etc. > runtests(@tests); > > Because there is no literal file "test_bundle.t 105", this dies. > The problem seems to be that Straps::analyze_file($test) simply tests > for '-e $test' and '-r $test'. > > It would be great if it could parse up the $test before doing these > tests. If not by default, then perhaps some configurable instance > variable could control this, with the current behavior as default.
Or alternatively if it's a single value, to just set a TEST_FOO_BAR environment variable.