Commits

Anonymous committed 9e47888

Added the Build.PL so we'll have a license meta-data and Test::Run support.
Bumped the version to Error-0.17007.

Comments (0)

Files changed (5)

+use strict;
+use warnings;
+
+use File::Spec;
+use lib File::Spec->catdir(File::Spec->curdir(), "inc");
+
+use Test::Run::Builder;
+
+my $build = Test::Run::Builder->new(
+    'module_name' => "Error",
+    'requires'    => 
+    {
+        'Scalar::Util' => 0,
+    },
+    'license'  => "perl",
+    'dist_abstract' => 'Error/exception handling in an OO-ish way',
+    'dist_author'   => 'Graham Barr <gbarr@pobox.com>',
+);
+$build->create_build_script;
-  - Added the "COPYRIGHT" section to the POD with the correct license.
-  (several people have asked me about what the license is.)
+Oct 18 2006 <shlomif@iglu.org.il> (Shlomi Fish)
+
+  Error.pm #0.17007
+  - Added the "COPYRIGHT" section to the POD with the correct
+    license. (several people have asked me about what the license is.)
+  - Added the Build.PL file so we'll have license meta data in the
+  distribution.
 
 Oct 07 2006 <shlomif@iglu.org.il> (Shlomi Fish)
 
+Build.PL
 ChangeLog
 examples/example.pl
 examples/next-in-loop/Error.pm-eval.pl
 examples/next-in-loop/Error.pm-next.pl
 examples/next-in-loop/README
 examples/warndie.pl
+inc/Test/Run/Builder.pm
 lib/Error.pm
 lib/Error/Simple.pm
 Makefile.PL

module/inc/Test/Run/Builder.pm

+package Test::Run::Builder;
+
+use strict;
+use warnings;
+
+use Module::Build;
+
+use vars qw(@ISA);
+
+@ISA = (qw(Module::Build));
+
+sub ACTION_runtest
+{
+    my ($self) = @_;
+    my $p = $self->{properties};
+
+    $self->depends_on('code');
+
+    local @INC = @INC;
+
+    # Make sure we test the module in blib/
+    unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
+		 File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));
+
+    $self->do_test_run_tests;
+}
+
+sub ACTION_distruntest {
+  my ($self) = @_;
+
+  $self->depends_on('distdir');
+
+  my $start_dir = $self->cwd;
+  my $dist_dir = $self->dist_dir;
+  chdir $dist_dir or die "Cannot chdir to $dist_dir: $!";
+  # XXX could be different names for scripts
+
+  $self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile
+      or die "Error executing 'Build.PL' in dist directory: $!";
+  $self->run_perl_script('Build')
+      or die "Error executing 'Build' in dist directory: $!";
+  $self->run_perl_script('Build', [], ['runtest'])
+      or die "Error executing 'Build test' in dist directory";
+  chdir $start_dir;
+}
+
+sub do_test_run_tests
+{
+    my $self = shift;
+
+    require Test::Run::CmdLine::Iface;
+
+    my $test_run =
+        Test::Run::CmdLine::Iface->new(
+            {
+                'test_files' => [glob("t/*.t")],
+            }   
+            # 'backend_params' => $self->_get_backend_params(),
+        );
+
+    return $test_run->run();
+}
+
+1;
+

module/lib/Error.pm

 use vars qw($VERSION);
 use 5.004;
 
-$VERSION = "0.17006"; 
+$VERSION = "0.17007"; 
 
 use overload (
 	'""'	   =>	'stringify',