2
#############################################################################
4
# If your platform/installation does not support make test, you can try this:
8
#############################################################################
12
use Test::Harness qw(&runtests $verbose);
17
#############################################################################
18
# Are we in the right directory? If not, the pathname component of $0
19
# must be pointing to it or we wouldn't be running this script.
22
unless(-f 'MANIFEST') {
23
my($script_name, $script_dir) = File::Basename::fileparse($0);
25
chdir($script_dir) || die "chdir($script_dir): $!";
30
#############################################################################
31
# Confirm distribution is complete (read MANIFEST file without assuming it
32
# has been converted to platform's native text format).
33
# Build up a list of test files as we go.
38
open(MNFST, 'MANIFEST') || die "open(MANIFEST): $!";
40
foreach(split(/[\r\n]+/, <MNFST>)) {
42
my $src_file = File::Spec->catfile(split('/'));
43
(-f $src_file ) || die "Could not find expected file: $src_file";
44
push @tests, $src_file if($src_file =~ /^t\b.*\.t$/);
49
print "XML::Distribution appears complete\n";
52
#############################################################################
53
# Build and populate what we need of blib (the build library)
57
(-d $path) || mkdir($path, 0777) || die "mkdir($path): $!";
59
$path = File::Spec->catdir($path, 'lib');
60
(-d $path) || mkdir($path, 0777) || die "mkdir($path): $!";
62
$path = File::Spec->catdir($path, 'XML');
63
(-d $path) || mkdir($path, 0777) || die "mkdir($path): $!";
65
$path = File::Spec->catfile($path, 'Simple.pm');
67
open(MOD, 'Simple.pm') || die "open(Simple.pm): $!";
72
open(MOD, ">$path") || die "open($path): $!";
76
print "Created $path\n";
80
#############################################################################
84
print "Running tests...\n";
86
unshift @INC, 'blib/lib';
88
@tests = @ARGV if(@ARGV);