Subject: | Error when used in conjunction with skip_all. |
Hello and thanks for Test::Portability::Files,
Often when running a test such as this I'd like it to be
developer-only, or requested by setting an environment variable.
For example:
use Test::More;
eval "use Test::Portability::Files";
plan skip_all => "Test::Portability::Files required for testing
filenames portability" if $@;
plan skip_all => 'Set TEST_PORTABILITY_FILES env var to enable test'
unless $ENV{'TEST_PORTABILITY_FILES'};
options(all_tests => 1); # to be hyper-strict
run_tests();
However, if the perl instance has Test::Portability::Files then
Test::Portability::Files::import is run and this calls plan() setting
tests to 1. This results in:
1..1
You tried to plan twice at test.t line X.
# Looks like your test died before it could output anything.
I'm not familiar with Test::Builder but I was wondering if the
call to plan() could be delayed by moving it inside run_tests() ?
(The skip_all usage as seen in the synopsis avoids this problem
because skip_all is only called if Test::Portability::Files is
not available)
Cheers,
Peter (Stig) Edwards