Subject: | eg/setup-extra-tests: Should these be reformulated as 'author tests'? |
Date: | Sat, 27 Jun 2015 10:12:26 -0400 |
To: | bug-File-Path [...] rt.cpan.org |
From: | James E Keenan <jkeen [...] verizon.net> |
The File-Path distribution currently contains a directory 'eg/' which
holds one file 'setup-extra-tests'. It appears that this file prepares
extra tests to be run in t/Path.t when tests are being run by root:
#####
$ head -6 eg/setup-extra-tests
use strict;
use File::Path; # heh
use Getopt::Std;
die "Not running as root (uid=$<)\n" if $<;
#####
I haven't actually run the tests as root yet -- if only because as a
developer I *never* run anything as root in my day-to-day work either
for $job of for OS -- but I'm wondering if it would be better to follow
current CPAN best practices and consider this an "author test" which
should be placed in a directory called 'xt/'.
We already have to exclude eg/setup-extra-tests from inclusion in the
Perl 5 core distribution. From Porting/Maintainers.pl:
#####
'File::Path' => {
'DISTRIBUTION' => 'DLAND/File-Path-2.09.tar.gz',
'FILES' => q[cpan/File-Path],
'EXCLUDED' => [
qw( eg/setup-extra-tests
t/pod.t
)
],
'MAP' => {
'' => 'cpan/File-Path/lib/File/',
't/' => 'cpan/File-Path/t/',
},
},
#####
If we were to move these tests to 'xt/', we could simplify the
'EXCLUDED' element above to '[ qr{^xt} ]', which many other dual-life
distributions follow.
Consider this a suggestion, not a full-fledged bug report or feature
request. Some data we might want to gather when evaluating this
suggestion: Do CPANtesters run these extra tests?
Thank you very much.
Jim Keenan