Skip Menu |
 

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

Report information
The Basics
Id: 62681
Status: open
Priority: 0/
Queue: Test-Steering

People
Owner: Nobody in particular
Requestors: norbi [...] nix.hu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)

Attachments
Test-Steering-harness_options-fix.diff



Subject: include_tests() dies if TAP::Harness options (hashref) are passed
Download (untitled) / with headers
text/plain 495b
It seems include_tests() does not remove the hashref from the actual list of tests passed to TAP::Harness->new() and it chokes on it: mendel@vger:~/tmp/13$ perl -MTest::Steering -E 'include_tests( { jobs => 9 }, "xt/author/*/t" );' Not a SCALAR reference at /usr/local/share/perl/5.10.0/TAP/Parser/IteratorFactory.pm line 262. mendel@vger:~/tmp/13$ See the attached patch that fixes it (test included, of course). Test::Steering: 0.02 TAP::Harness: 3.22 Test::More: 0.96 Perl: 5.10.0 (Debian)
Subject: Test-Steering-harness_options-fix.diff
diff -Naur a/Test-Steering-0.02/lib/Test/Steering/Wheel.pm b/Test-Steering-0.02/lib/Test/Steering/Wheel.pm --- a/Test-Steering-0.02/lib/Test/Steering/Wheel.pm 2008-01-08 14:34:20.000000000 +0100 +++ b/Test-Steering-0.02/lib/Test/Steering/Wheel.pm 2010-11-03 22:51:07.000000000 +0100 @@ -234,8 +234,8 @@ map { 'ARRAY' eq ref $_ ? $_ : [ $_, $_ ] } map { ref $_ ? $_ : glob $_ } @tests ) { - if ( 'HASH' eq ref $t ) { - %options = ( %options, %$t ); + if ( 'HASH' eq ref $t->[0] ) { + %options = ( %options, %{ $t->[0] } ); } else { push @real_tests, diff -Naur a/Test-Steering-0.02/t/conformance.t b/Test-Steering-0.02/t/conformance.t --- a/Test-Steering-0.02/t/conformance.t 2008-01-08 14:34:20.000000000 +0100 +++ b/Test-Steering-0.02/t/conformance.t 2010-11-03 23:06:25.000000000 +0100 @@ -228,6 +228,20 @@ ], stderr => [] }, + { + args => [ + { test_args => [ 'foo', 'bar' ] }, + 't/sample-tests/diag_argv' + ], + stdout => [ + "TAP version 13", + "ok 1", + "# foo bar", + "ok 2 t/sample-tests/diag_argv done", + "1..2" + ], + stderr => [] + }, ); plan tests => @schedule * 3; diff -Naur a/Test-Steering-0.02/t/sample-tests/diag_argv b/Test-Steering-0.02/t/sample-tests/diag_argv --- a/Test-Steering-0.02/t/sample-tests/diag_argv 1970-01-01 01:00:00.000000000 +0100 +++ b/Test-Steering-0.02/t/sample-tests/diag_argv 2010-11-03 23:00:23.000000000 +0100 @@ -0,0 +1,5 @@ +print <<DUMMY_TEST; +1..1 +ok 1 +# @ARGV +DUMMY_TEST
I can confirm both that the bug exists, and that the patch provided addresses it.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.