summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/porting/authors.t10
-rw-r--r--t/porting/cmp_version.t8
-rw-r--r--t/porting/manifest.t20
3 files changed, 17 insertions, 21 deletions
diff --git a/t/porting/authors.t b/t/porting/authors.t
index 28ca1cabff..5fb933f38e 100644
--- a/t/porting/authors.t
+++ b/t/porting/authors.t
@@ -1,13 +1,11 @@
#!./perl -w
-
# Test that there are no missing authors in AUTHORS
+
BEGIN {
- chdir '..' unless -d 't';
- unshift @INC, 'lib';
+ @INC = '..' if -f '../TestInit.pm';
}
-
+use TestInit 'T'; # T is chdir to the top level
use strict;
-use warnings;
if (! -d '.git' ) {
print "1..0 # SKIP: not being run from a git checkout\n";
@@ -15,6 +13,6 @@ if (! -d '.git' ) {
}
my $dotslash = $^O eq "MSWin32" ? ".\\" : "./";
-system("git log --pretty=fuller | ${dotslash}perl -Ilib Porting/checkAUTHORS.pl --tap -");
+system("git log --pretty=fuller | ${dotslash}perl Porting/checkAUTHORS.pl --tap -");
# EOF
diff --git a/t/porting/cmp_version.t b/t/porting/cmp_version.t
index 7384416658..81cbf2c704 100644
--- a/t/porting/cmp_version.t
+++ b/t/porting/cmp_version.t
@@ -5,10 +5,12 @@
# Adapted from Porting/cmpVERSION.pl by Abigail
# Changes folded back into that by Nicholas
+BEGIN {
+ @INC = '..' if -f '../TestInit.pm';
+}
+use TestInit 'T'; # T is chdir to the top level
use strict;
-chdir '..' unless -d 't';
-
if (! -d '.git' ) {
print "1..0 # SKIP: not being run from a git checkout\n";
exit 0;
@@ -16,4 +18,4 @@ if (! -d '.git' ) {
my $dotslash = $^O eq "MSWin32" ? ".\\" : "./";
-system "${dotslash}perl -Ilib Porting/cmpVERSION.pl --exclude --tap";
+system "${dotslash}perl Porting/cmpVERSION.pl --exclude --tap";
diff --git a/t/porting/manifest.t b/t/porting/manifest.t
index 48dd3aca41..5534aca184 100644
--- a/t/porting/manifest.t
+++ b/t/porting/manifest.t
@@ -3,17 +3,15 @@
# Test the well-formed-ness of the MANIFEST file.
BEGIN {
- chdir 't';
- @INC = '../lib';
+ @INC = '..' if -f '../TestInit.pm';
}
+use TestInit 'T'; # T is chdir to the top level
-use strict;
-use File::Spec;
-require './test.pl';
+require 't/test.pl';
plan('no_plan');
-my $manifest = File::Spec->catfile(File::Spec->updir(), 'MANIFEST');
+my $manifest = 'MANIFEST';
open my $m, '<', $manifest or die "Can't open '$manifest': $!";
my @files;
@@ -29,8 +27,7 @@ while (<$m>) {
push @files, $file;
isnt($file, undef, "Line $. doesn't start with a blank") or next;
- # Remember, we're running from t/
- ok(-f "../$file", "File $file exists");
+ ok(-f $file, "File $file exists");
if ($separator !~ tr/\t//c) {
# It's all tabs
next;
@@ -48,17 +45,16 @@ close $m or die $!;
# Test that MANIFEST is properly sorted
SKIP: {
- skip("'Porting/manisort' not found", 1) if (! -f '../Porting/manisort');
+ skip("'Porting/manisort' not found", 1) if (! -f 'Porting/manisort');
- my $result = runperl('progfile' => '../Porting/manisort',
- 'args' => [ '-c', '../MANIFEST' ],
+ my $result = runperl('progfile' => 'Porting/manisort',
+ 'args' => [ '-c', $manifest ],
'stderr' => 1);
like($result, qr/is sorted properly/, 'MANIFEST sorted properly');
}
SKIP: {
- chdir "..";
skip("not under git control", 3) unless -d '.git';
chomp(my @repo= grep { !/\.gitignore$/ } `git ls-files`);
skip("git ls-files didnt work",3)