~ubuntu-branches/ubuntu/jaunty/horae/jaunty

« back to all changes in this revision

Viewing changes to 0CPAN/XML-Simple-2.14/maketest

  • Committer: Bazaar Package Importer
  • Author(s): Carlo Segre
  • Date: 2008-02-23 23:13:02 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080223231302-mnyyxs3icvrus4ke
Tags: 066-3
Apply patch to athena_parts/misc.pl for compatibility with 
perl-tk 804.28.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!perl -w
2
 
#############################################################################
3
 
#
4
 
# If your platform/installation does not support make test, you can try this:
5
 
#
6
 
#    perl maketest
7
 
#
8
 
#############################################################################
9
 
 
10
 
use strict;
11
 
use File::Spec;
12
 
use Test::Harness qw(&runtests $verbose);
13
 
 
14
 
$verbose = 0;
15
 
 
16
 
 
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.
20
 
#
21
 
 
22
 
unless(-f 'MANIFEST') {
23
 
  my($script_name, $script_dir) = File::Basename::fileparse($0);
24
 
  if($script_dir) {
25
 
    chdir($script_dir) || die "chdir($script_dir): $!";
26
 
  }
27
 
}
28
 
 
29
 
 
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.
34
 
#
35
 
 
36
 
my @tests = ();
37
 
{
38
 
  open(MNFST, 'MANIFEST') || die "open(MANIFEST): $!";
39
 
  local($/) = undef;
40
 
  foreach(split(/[\r\n]+/, <MNFST>)) {
41
 
    next unless(/\S/);
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$/);
45
 
  }
46
 
  close(MNFST);
47
 
}
48
 
 
49
 
print "XML::Distribution appears complete\n";
50
 
 
51
 
 
52
 
#############################################################################
53
 
# Build and populate what we need of blib (the build library)
54
 
#
55
 
 
56
 
my $path = 'blib';
57
 
(-d $path) || mkdir($path, 0777) || die "mkdir($path): $!";
58
 
 
59
 
$path = File::Spec->catdir($path, 'lib');
60
 
(-d $path) || mkdir($path, 0777) || die "mkdir($path): $!";
61
 
 
62
 
$path = File::Spec->catdir($path, 'XML');
63
 
(-d $path) || mkdir($path, 0777) || die "mkdir($path): $!";
64
 
 
65
 
$path = File::Spec->catfile($path, 'Simple.pm');
66
 
unless(-f $path) {
67
 
  open(MOD, 'Simple.pm') || die "open(Simple.pm): $!";
68
 
  {
69
 
    local($/) = undef;
70
 
    my $module = <MOD>;
71
 
    close(MOD);
72
 
    open(MOD, ">$path") || die "open($path): $!";
73
 
    print MOD $module;
74
 
    close(MOD);
75
 
  }
76
 
  print "Created $path\n";
77
 
}
78
 
 
79
 
 
80
 
#############################################################################
81
 
# Run the tests
82
 
#
83
 
 
84
 
print "Running tests...\n";
85
 
 
86
 
unshift @INC, 'blib/lib';
87
 
 
88
 
@tests = @ARGV if(@ARGV);
89
 
 
90
 
runtests @tests;
91
 
 
92