From: Jesse Vincent Date: Sat, 1 Aug 2009 17:41:40 +0000 (+0100) Subject: Flipped checkcase.pl from a porting tool to an actual test file X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf61c8520d02a6b587570be7e39a73772fc8ed54;p=p5sagit%2Fp5-mst-13.2.git Flipped checkcase.pl from a porting tool to an actual test file --- diff --git a/MANIFEST b/MANIFEST index 3f5cf85..532c95f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3752,7 +3752,6 @@ Porting/check83.pl Check whether we are 8.3-friendly Porting/checkansi.pl Check source code for ANSI-C violations Porting/checkARGS_ASSERT.pl Check we use every PERL_ARGS_ASSERT* macro Porting/checkAUTHORS.pl Check that the AUTHORS file is complete -Porting/checkcase.pl Check whether we are case-insensitive-fs-friendly Porting/checkcfgvar.pl Check that config scripts define all symbols Porting/checkURL.pl Check whether we have working URLs Porting/checkVERSION.pl Check whether we have $VERSIONs @@ -4385,6 +4384,7 @@ t/pod/testpods/lib/Pod/Stuff.pm Sample data for t/pod/find.t t/pod/twice.t Test Pod::Parser t/pod/usage2.pod Test POD for pod2usage tests t/pod/usage.pod Test POD for pod2usage tests +t/porting/checkcase.t Check whether we are case-insensitive-fs-friendly t/README Instructions for regression tests t/run/cloexec.t Test close-on-exec. t/run/exit.t Test perl's exit status. diff --git a/Porting/checkcase.pl b/t/porting/checkcase.t similarity index 63% rename from Porting/checkcase.pl rename to t/porting/checkcase.t index 66dccd2..82be050 100644 --- a/Porting/checkcase.pl +++ b/t/porting/checkcase.t @@ -2,11 +2,20 @@ # Finds the files that have the same name, case insensitively, # in the current directory and its subdirectories +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + + + use warnings; use strict; use File::Find; my %files; +my $test_count = 0; + find(sub { my $name = $File::Find::name; # Assumes that the path separator is exactly one character. @@ -18,9 +27,10 @@ my $failed; foreach (values %files) { if (@$_ > 1) { - print join(", ", @$_), "\n"; - $failed++; - } + print "not ok ".++$test_count. " - ". join(", ", @$_), "\n"; + } else { + print "ok ".++$test_count. " - ". join(", ", @$_), "\n"; + } } -print "no similarly named files found\n" unless $failed; +print "1..".$test_count."\n";