diff options
author | Guillem Jover <guillem@debian.org> | 2014-09-28 15:13:47 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-01-28 20:50:30 +0100 |
commit | ace4a0e8f7b6d468eb62f847734c4deeb616ec13 (patch) | |
tree | 0c37559915f9d4565ae124151dd81d727c042724 /test | |
parent | e0b76a5e48404babba62342a682a2b6c3ad79a08 (diff) | |
download | dpkg-ace4a0e8f7b6d468eb62f847734c4deeb616ec13.tar.gz |
test: Rename TAP test directories from test to t
Diffstat (limited to 'test')
-rw-r--r-- | test/critic.t | 139 | ||||
-rw-r--r-- | test/critic/perlcriticrc | 80 | ||||
-rw-r--r-- | test/pod.t | 32 |
3 files changed, 0 insertions, 251 deletions
diff --git a/test/critic.t b/test/critic.t deleted file mode 100644 index 5f7c5a894..000000000 --- a/test/critic.t +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -use strict; -use warnings; - -use Test::More; - -unless (defined $ENV{DPKG_DEVEL_MODE}) { - plan skip_all => 'not running in development mode'; -} - -if (defined $ENV{srcdir}) { - chdir $ENV{srcdir} or die "cannot chdir to source directory: $!"; -} - -if (not eval { require Test::Perl::Critic }) { - plan skip_all => 'Test::Perl::Critic required to criticize code'; -} -if (not eval { require Perl::Critic::Utils }) { - plan skik_all => 'Perl::Critic::Utils required to criticize code'; -} - -my @policies = qw( - BuiltinFunctions::ProhibitBooleanGrep - BuiltinFunctions::ProhibitLvalueSubstr - BuiltinFunctions::ProhibitReverseSortBlock - BuiltinFunctions::ProhibitSleepViaSelect - BuiltinFunctions::ProhibitStringySplit - BuiltinFunctions::ProhibitUniversalCan - BuiltinFunctions::ProhibitUniversalIsa - BuiltinFunctions::ProhibitUselessTopic - BuiltinFunctions::ProhibitVoidGrep - BuiltinFunctions::ProhibitVoidMap - BuiltinFunctions::RequireBlockGrep - BuiltinFunctions::RequireBlockMap - BuiltinFunctions::RequireGlobFunction - BuiltinFunctions::RequireSimpleSortBlock - ClassHierarchies::ProhibitAutoloading - ClassHierarchies::ProhibitExplicitISA - ClassHierarchies::ProhibitOneArgBless - CodeLayout::ProhibitHardTabs - CodeLayout::ProhibitQuotedWordLists - CodeLayout::ProhibitTrailingWhitespace - CodeLayout::RequireConsistentNewlines - ControlStructures::ProhibitCStyleForLoops - ControlStructures::ProhibitLabelsWithSpecialBlockNames - ControlStructures::ProhibitMutatingListFunctions - ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions - ControlStructures::ProhibitUntilBlocks - Documentation::RequirePackageMatchesPodName - InputOutput::ProhibitBarewordFileHandles - InputOutput::ProhibitInteractiveTest - InputOutput::ProhibitJoinedReadline - InputOutput::ProhibitOneArgSelect - InputOutput::ProhibitReadlineInForLoop - InputOutput::ProhibitTwoArgOpen - InputOutput::RequireBracedFileHandleWithPrint - InputOutput::RequireCheckedOpen - InputOutput::RequireEncodingWithUTF8Layer - Miscellanea::ProhibitFormats - Miscellanea::ProhibitUnrestrictedNoCritic - Miscellanea::ProhibitUselessNoCritic - Modules::ProhibitConditionalUseStatements - Modules::ProhibitEvilModules - Modules::RequireBarewordIncludes - Modules::RequireEndWithOne - Modules::RequireExplicitPackage - Modules::RequireFilenameMatchesPackage - NamingConventions::Capitalization - Objects::ProhibitIndirectSyntax - RegularExpressions::ProhibitSingleCharAlternation - RegularExpressions::ProhibitUnusedCapture - RegularExpressions::ProhibitUnusualDelimiters - RegularExpressions::ProhibitUselessTopic - RegularExpressions::RequireBracesForMultiline - Subroutines::ProhibitExplicitReturnUndef - Subroutines::ProhibitNestedSubs - Subroutines::ProhibitReturnSort - Subroutines::ProhibitUnusedPrivateSubroutines - Subroutines::ProtectPrivateSubs - TestingAndDebugging::ProhibitNoStrict - TestingAndDebugging::ProhibitNoWarnings - TestingAndDebugging::RequireTestLabels - TestingAndDebugging::RequireUseStrict - TestingAndDebugging::RequireUseWarnings - ValuesAndExpressions::ProhibitCommaSeparatedStatements - ValuesAndExpressions::ProhibitComplexVersion - ValuesAndExpressions::ProhibitInterpolationOfLiterals - ValuesAndExpressions::ProhibitLongChainsOfMethodCalls - ValuesAndExpressions::ProhibitMismatchedOperators - ValuesAndExpressions::ProhibitMixedBooleanOperators - ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters - ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator - ValuesAndExpressions::ProhibitVersionStrings - ValuesAndExpressions::RequireConstantVersion - ValuesAndExpressions::RequireNumberSeparators - ValuesAndExpressions::RequireQuotedHeredocTerminator - ValuesAndExpressions::RequireUpperCaseHeredocTerminator - Variables::ProhibitAugmentedAssignmentInDeclaration - Variables::ProhibitConditionalDeclarations - Variables::ProhibitLocalVars - Variables::ProhibitMatchVars - Variables::ProhibitPackageVars - Variables::ProhibitPerl4PackageNames - Variables::ProhibitUnusedVariables - Variables::ProtectPrivateVars - Variables::RequireLexicalLoopIterators - Variables::RequireNegativeIndices -); - -Test::Perl::Critic->import( - -profile => 'test/critic/perlcriticrc', - -verbose => 8, - -include => \@policies, - -only => 1, -); - -my @dirs = qw(test src/t utils/t scripts/t dselect scripts/Dpkg); -my @files = glob 'scripts/Dpkg.pm scripts/*.pl scripts/changelog/*.pl'; -push @files, Perl::Critic::Utils::all_perl_files(@dirs); - -plan tests => scalar @files; - -for my $file (@files) { - critic_ok($file); -} diff --git a/test/critic/perlcriticrc b/test/critic/perlcriticrc deleted file mode 100644 index 05a50fc2e..000000000 --- a/test/critic/perlcriticrc +++ /dev/null @@ -1,80 +0,0 @@ -# Perl Critic configuration file -severity = 1 -verbose = %f %l:%c (Severity: %s)\n %P (%s)\n near '%r'\n%d\n -program-extensions = .pl .t - -[ControlStructures::ProhibitMutatingListFunctions] -add_list_funcs = Dpkg::Util::any Dpkg::Util::none - -[RegularExpressions::ProhibitUnusualDelimiters] -allow_all_brackets = 1 - -#[RegularExpressions::RequireExtendedFormatting] -#minimum_regex_length_to_complain_about = 60 - -[ValuesAndExpressions::ProhibitInterpolationOfLiterals] -# TODO: switch these to q{} ? -allow_if_string_contains_single_quote = 1 - -# Complex is not always bad. -[-BuiltinFunctions::ProhibitComplexMappings] -# Needed when generating code. -[-BuiltinFunctions::ProhibitStringyEval] -# FIXME: Bogus check. -[-Documentation::PodSpelling] -# While this might be good for performance, it is bad for keeping docs updated. -[-Documentation::RequirePodAtEnd] -# FIXME: Bogus check. -[-Documentation::RequirePodLinksIncludeText] -# TODO: Standardize sections, but the ones from this are not usable. -[-Documentation::RequirePodSections] -# Too many false positives. -[-CodeLayout::RequireTidyCode] -# Forcing this just turns into noise (depending on the context, it makes sense). -[-CodeLayout::RequireTrailingCommas] -# These are fine. -[-ControlStructures::ProhibitCascadingIfElse] -# These are fine, too many in the code base anyway. -[-ControlStructures::ProhibitPostfixControls] -# These are fine, usually as long as they are not double negations. -[-ControlStructures::ProhibitUnlessBlocks] -# FIXME: Too many false positives. -[-ControlStructures::ProhibitUnreachableCode] -# TODO: Check it out, add new Dpkg::Program module? -[-InputOutput::ProhibitBacktickOperators] -# Needed, using <>/<@ARGV> is not correct, Prompt is not a core module. -[-InputOutput::ProhibitExplicitStdin] -# TODO: Maybe, some of these are part of the public/current API. -[-Modules::ProhibitAutomaticExportation] -# Complex is not always bad. -[-Modules::ProhibitExcessMainComplexity] -# FIXME: Too many false positives; non-modules all trigger. -[-Modules::RequireVersionVar] -# These are fine. -[-NamingConventions::ProhibitAmbiguousNames] -# When . is used in the code it means what it does. -[-RegularExpressions::RequireDotMatchAnything] -# When ^ or $ are used in the code they mean what they do. -[-RegularExpressions::RequireLineBoundaryMatching] -# TODO: While valid, these are part of the public/current API. -[-Subroutines::ProhibitBuiltinHomonyms] -# Needed. -[-Subroutines::ProhibitSubroutinePrototypes] -# Adding these seems like more noise. -[-Subroutines::RequireFinalReturn] -# Readers need to know perl, English module is worse. -[-Variables::ProhibitPunctuationVars] -# Readers need to know perl. -[-Variables::RequireInitializationForLocalVars] -# FIXME: Too many false positives; on ::main and for $ENV, $SIG, $?, $a, $b. -[-Variables::RequireLocalizedPunctuationVars] -# Readonly is not a core module. -[-ValuesAndExpressions::ProhibitConstantPragma] -# TODO: Check it out, using other quotes might be less readable and uniform. -[-ValuesAndExpressions::ProhibitEmptyQuotes] -# Used for help output. -[-ValuesAndExpressions::ProhibitImplicitNewlines] -# Octals are fine. -[-ValuesAndExpressions::ProhibitLeadingZeros] -# TODO: Check it out, some magic numbers are fine, octals for example. -[-ValuesAndExpressions::ProhibitMagicNumbers] diff --git a/test/pod.t b/test/pod.t deleted file mode 100644 index 312105a0c..000000000 --- a/test/pod.t +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -use strict; -use warnings; - -use Test::More; - -eval 'use Test::Pod 1.00'; -plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@; - -if (defined $ENV{srcdir}) { - chdir $ENV{srcdir} or die "cannot chdir to source directory: $!"; -} - -my @dirs = qw(scripts/Dpkg); -my @files = qw(scripts/Dpkg.pm); -push @files, all_pod_files(@dirs); - -all_pod_files_ok(@files); |