Commits

Anonymous committed 699a312

Build.PL'ed the distribution.

Comments (0)

Files changed (4)

+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 => "Devel::LineTrace",
+    dist_version_from => "lib/Devel/LineTrace.pm",
+    license => "bsd",
+);
+
+$build->create_build_script;
+
+Build.PL
+COPYING
+inc/Test/Run/Builder.pm
+INSTALL
+lib/Devel/LineTrace.pm
+Makefile.PL
 MANIFEST
-COPYING
-INSTALL
+META.yml                                Module meta-data (added by MakeMaker)
 README
-Makefile.PL
-lib/Devel/LineTrace.pm
-META.yml                                Module meta-data (added by MakeMaker)
+t/00onetrace.t
 t/01twotraces.t
-t/00onetrace.t
 t/02cancelled.t
 t/input/cancelled_trace.txt
 t/input/onetrace.txt
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Devel-LineTrace
-version:      0.1.5
-version_from: lib/Devel/LineTrace.pm
-installdirs:  site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.10_08
+---
+name: Devel-LineTrace
+version: 0.1.5
+author:
+  - 'Shlomi Fish E<lt>shlomif@vipe.technion.ac.ilE<gt>'
+abstract: Apply traces to individual lines.
+license: bsd
+resources:
+  license: http://www.opensource.org/licenses/bsd-license.php
+provides:
+  DB:
+    file: lib/Devel/LineTrace.pm
+  Devel::LineTrace:
+    file: lib/Devel/LineTrace.pm
+    version: 0.1.5
+generated_by: Module::Build version 0.2805
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

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;
+