t/*_without_optional_dependencies.t
t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run
t/Variables/RequireLocalizedPunctuationVars.run
+xt/author/generated/t/*_without_optional_dependencies.t
+xt/author/generated/xt/author/*_without_optional_dependencies.t
########################################################################
BEGIN {
- require 5.006001;
+ use 5.006001;
}
use strict;
emit_tar_warning_if_necessary
>;
-my $warning = <<'END_WARNING';
-
-###################################################
-# NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! #
-#-------------------------------------------------#
-# In this version of Perl::Critic, some of #
-# the Policy modules have been renamed to better #
-# better reflect the intent of the Policy. If #
-# you have an older version of Perl::Critic #
-# already installed, it will cause many of the #
-# tests to fail and the new version will not work #
-# properly. #
-# #
-# I strongly advise you to remove the current #
-# version of Perl::Critic before proceeding with #
-# this installation. In most cases, this can be #
-# done by deleting everything below the #
-# Perl/Critic/Policy directory in your site_perl #
-# location. #
-# #
-# Also, if you have created a .perlcriticrc file, #
-# you will need to update it to match the new #
-# Policy module names. #
-# #
-# Sorry for the inconvenience. #
-# #
-# -Jeff <thaljef@cpan.org> #
-###################################################
-
-END_WARNING
-
-
-eval {
- require Perl::Critic;
- warn $warning if $Perl::Critic::VERSION < 0.14;
-};
-
emit_tar_warning_if_necessary();
-my $builder = Module::Build->new(
+
+my $class = Module::Build->subclass( code => <<'END_SUBCLASS' );
+
+ sub ACTION_authortest {
+ my ($self) = @_;
+
+ $self->depends_on('build');
+ $self->depends_on('manifest');
+ $self->depends_on('distmeta');
+
+ $self->test_files( qw< t xt/author > );
+ $self->recursive_test_files(1);
+
+ $self->depends_on('test');
+
+ return;
+ } # end ACTION_authortest()
+
+ sub ACTION_distdir {
+ my ($self) = @_;
+
+ $self->depends_on('authortest');
+
+ return $self->SUPER::ACTION_distdir;
+ } # end ACTION_distdir
+
+END_SUBCLASS
+
+my $builder = $class->new(
module_name => 'Perl::Critic',
dist_author => 'Jeffrey Thalhammer <thaljef@cpan.org>',
dist_abstract => 'Critique Perl source code for best-practices.',
^README\.developer$
\.PPI$
-^t/.*_without_optional_dependencies.t$
+_without_optional_dependencies.t$
^t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run$
^t/Variables/RequireLocalizedPunctuationVars.run$
emit_tar_warning_if_necessary
>;
-my $warning = <<'END_WARNING';
-
-###################################################
-# NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! #
-#-------------------------------------------------#
-# In this version of Perl::Critic, some of #
-# the Policy modules have been renamed to better #
-# better reflect the intent of the Policy. If #
-# you have an older version of Perl::Critic #
-# already installed, it will cause many of the #
-# tests to fail and the new version will not work #
-# properly. #
-# #
-# I strongly advise you to remove the current #
-# version of Perl::Critic before proceeding with #
-# this installation. In most cases, this can be #
-# done by deleting everything below the #
-# Perl/Critic/Policy directory in your site_perl #
-# location. #
-# #
-# Also, if you have created a .perlcriticrc file, #
-# you will need to update it to match the new #
-# Policy module names. #
-# #
-# Sorry for the inconvenience. #
-# #
-# -Jeff <thaljef@cpan.org> #
-###################################################
-
-END_WARNING
-
-
-eval {
- require Perl::Critic;
- warn $warning if $Perl::Critic::VERSION < 0.14;
-};
-
emit_tar_warning_if_necessary();
use Devel::CheckOS qw< os_is >;
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw<
- should_skip_author_tests
->;
-
sub recommended_module_versions {
return (
t/04_defaults.t
t/05_utils.t
t/05_utils_ppi.t
+ t/05_utils_pod.t
t/06_violation.t
t/07_perlcritic.t
t/08_document.t
t/15_statistics.t
t/20_policy_podspelling.t
t/20_policy_requiretidycode.t
- t/80_policysummary.t
+ xt/author/80_policysummary.t
t/92_memory_leaks.t
- t/94_includes.t
+ xt/author/94_includes.t
>;
return
map
- { $_ . '_without_optional_dependencies.t' }
+ { "xt/author/generated/${_}_without_optional_dependencies.t" }
@tests_to_be_wrapped;
}
$PL_files{'t/Variables/RequireLocalizedPunctuationVars.run.PL'} =
't/Variables/RequireLocalizedPunctuationVars.run';
- if (should_skip_author_tests()) {
- print
- "\nWill not generate extra author tests. Set "
- . '$ENV{TEST_AUTHOR_PERL_CRITIC} to a true value to have them generated.'
- . "\n\n";
- }
- else {
- $PL_files{'t/generate_without_optional_dependencies_wrappers.PL'} =
- [ test_wrappers_to_generate() ];
- }
+ $PL_files{'t/generate_without_optional_dependencies_wrappers.PL'} =
+ [ test_wrappers_to_generate() ];
return \%PL_files;
}
foreach my $test_program_name (@ARGV) {
my ($wrapped_test_name) =
- $test_program_name =~ m{
+ $test_program_name =~ m<
\A
- ( t/ [\w.]+ \.t ) # test to be wrapped
- _without_optional_dependencies\.t # suffix the new test will have
+ xt/author/generated/
+ ( (?: t | xt/author ) / [\w.]+ \.t ) # test to be wrapped
+ _without_optional_dependencies\.t # suffix the new test will have
\z
- }xms;
+ >xms;
if (not $wrapped_test_name) {
confess
'Could not figure out the name of the test to wrap from "'
use strict;
use warnings;
-use English qw{-no_match_vars};
-our \$VERSION = $VERSION;
+use English qw{-no_match_vars};
use lib 't/tlib';
-use English qw(-no_match_vars);
-
use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
get_skip_all_tests_tap
};
-#-----------------------------------------------------------------------------
+our \$VERSION = $VERSION;
-if ( should_skip_author_tests() ) {
- print get_skip_all_tests_tap(), get_author_test_skip_message(), "\\n";
- exit 0;
-}
+#-----------------------------------------------------------------------------
eval <<'END_HIDE_MODULES';
use Test::Without::Module qw{
our $VERSION = '1.083_001';
our @EXPORT_OK = qw(
- should_skip_author_tests
- get_author_test_skip_message
get_skip_all_tests_tap
);
#-----------------------------------------------------------------------------
-# Note: this code is duplicated in lib/Perl/Critic/TestUtils.pm.
-# If you change this here, make sure to change it there.
-
-sub should_skip_author_tests {
- return not $ENV{TEST_AUTHOR_PERL_CRITIC};
-}
-
-#-----------------------------------------------------------------------------
-
-sub get_author_test_skip_message {
- ## no critic (RequireInterpolation);
- return 'Author test. Set $ENV{TEST_AUTHOR_PERL_CRITIC} to a true value to run.';
-}
-
-#-----------------------------------------------------------------------------
-
sub get_skip_all_tests_tap {
return '1..0 # Skip ';
}
=head1 SYNOPSIS
use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
get_skip_all_tests_tap
};
- if ( should_skip_author_tests() ) {
- print get_skip_all_tests_tap(), get_author_test_skip_message(), "\n";
- exit 0;
- }
-
-
use Test::More;
- if (should_skip_author_tests()) {
- plan skip_all => get_author_test_skip_message();
+ if ($should_not_run) {
+ plan skip_all => 'Hey! I shouldn't be run!';
}
=head1 DESCRIPTION
=over
-=item C< should_skip_author_tests() >
-
-Answers whether author tests should run.
-
-
-=item C< get_author_test_skip_message() >
-
-Returns a string containing the message that should be emitted when a
-test is skipped due to it being an author test when author tests are
-not enabled.
-
-
=item C< get_skip_all_tests_tap() >
Returns a string representing the TAP (Test Anything Protocol) output
any Test::* modules.
+=back
+
+
=head1 AUTHOR
Elliot Shank <perl@cpan.org>
use strict;
use warnings;
-use lib 't/tlib';
-
use English qw( -no_match_vars );
use File::Spec qw();
use Test::More;
use Perl::Critic::Utils qw{ :characters };
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
-};
use Perl::Critic::TestUtils qw{ starting_points_including_examples };
# Note: "use PolicyFactory" *must* appear after "use TestUtils" for the
#-----------------------------------------------------------------------------
-if (should_skip_author_tests()) {
- plan skip_all => get_author_test_skip_message();
-}
-
-#-----------------------------------------------------------------------------
-
eval { require Test::Perl::Critic; };
plan skip_all => 'Test::Perl::Critic required to criticise code' if $EVAL_ERROR;
#-----------------------------------------------------------------------------
# Run critic against all of our own files
-my $rcfile = File::Spec->catfile( 't', '40_perlcriticrc' );
+my $rcfile = File::Spec->catfile( 'xt', 'author', '40_perlcriticrc' );
Test::Perl::Critic->import( -profile => $rcfile );
all_critic_ok( starting_points_including_examples() );
use strict;
use warnings;
-use lib 't/tlib';
-
use File::Spec;
use Test::More;
use List::MoreUtils qw(any);
use Perl::Critic::PolicyFactory ( -test => 1 );
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
-};
use Perl::Critic::TestUtils qw{ bundled_policy_names };
#-----------------------------------------------------------------------------
-if (should_skip_author_tests()) {
- plan skip_all => get_author_test_skip_message();
-}
-
if (open my ($fh), '<', File::Spec->catfile(qw(lib Perl Critic PolicySummary.pod))) {
my $content = do {local $/=undef; <$fh> };
use warnings;
use strict;
-use lib 't/tlib';
-
use File::Find;
use Test::More;
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
-};
-
-if (should_skip_author_tests()) {
- plan skip_all => get_author_test_skip_message();
-}
-
plan 'no_plan';
my $last_version = undef;
use warnings;
use strict;
-use lib 't/tlib';
-
use Test::More;
use File::Find;
use PPI::Document;
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
-};
-
-if (should_skip_author_tests()) {
- plan skip_all => get_author_test_skip_message();
-}
-
my %implied = (
# Universal
SUPER => 1,
use strict;
use warnings;
-use lib 't/tlib';
-
use Test::More;
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
- should_skip_author_tests
- get_author_test_skip_message
-};
-
-if (should_skip_author_tests()) {
- plan skip_all => get_author_test_skip_message();
-}
-
-eval
-{
+eval {
require Test::Kwalitee;
Test::Kwalitee->import( tests => [ qw{ -no_pod_errors -no_symlinks } ] );
};