[Bps-public-commit] r15737 - in Test-Chimps-Client/trunk: lib/Test/Chimps

alexmv at bestpractical.com alexmv at bestpractical.com
Wed Sep 3 17:37:58 EDT 2008


Author: alexmv
Date: Wed Sep  3 17:37:55 2008
New Revision: 15737

Modified:
   Test-Chimps-Client/trunk/   (props changed)
   Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm

Log:
 r36851 at kohr-ah (orig r15736):  alexmv | 2008-09-03 17:37:41 -0400
  * TAP::Harness has support for explicit libs, instead of @INC munging


Modified: Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm
==============================================================================
--- Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm	(original)
+++ Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm	Wed Sep  3 17:37:55 2008
@@ -66,7 +66,7 @@
 use base qw/Class::Accessor/;
 __PACKAGE__->mk_ro_accessors(qw/server config_file simulate/);
 __PACKAGE__->mk_accessors(
-  qw/_added_to_inc _env_stack _checkout_paths _config projects iterations/);
+  qw/_env_stack _checkout_paths _config projects iterations/);
 
 # add a signal handler so destructor gets run
 $SIG{INT} = sub {print "caught sigint.  cleaning up...\n"; exit(1)};
@@ -107,7 +107,6 @@
   foreach my $key (keys %args) {
     $self->{$key} = $args{$key};
   }
-  $self->_added_to_inc([]);
   $self->_env_stack([]);
   $self->_checkout_paths([]);
 
@@ -151,7 +150,7 @@
   $info_out =~ m/^Last Changed Author: (\w+)/m;
   my $committer = $1;
 
-  $self->_checkout_project($config->{$project}, $revision);
+  my @libs = $self->_checkout_project($config->{$project}, $revision);
   my @dbs = $self->_list_dbs;
 
   print "running tests for $project\n";
@@ -167,18 +166,13 @@
           osvers    => $Config{osvers},
           archname  => $Config{archname},
       },
-      jobs => $self->{jobs},
+      jobs => $config->{$project}{jobs} || $self->{jobs},
+      lib => \@libs,
   } );
   $harness->runtests(glob($test_glob));
 
   $self->_unroll_env_stack;
 
-  foreach my $libdir (@{$self->_added_to_inc}) {
-    print "removing $libdir from \@INC\n";
-    shift @INC;
-  }
-  $self->_added_to_inc([]);
-
   chdir(File::Spec->rootdir);
 
   foreach my $tmpdir (@{$self->_checkout_paths}) {
@@ -337,28 +331,15 @@
 
   chdir($projectdir);
 
-  my $old_perl5lib = $ENV{PERL5LIB};
-  $ENV{PERL5LIB} = join($Config{path_sep}, @{$self->_added_to_inc}) .
-    ':' . $ENV{PERL5LIB};
-  if (defined $project->{configure_cmd}) {
-    system($project->{configure_cmd});
-  }
-  $ENV{PERL5LIB} = $old_perl5lib;
+  system($project->{configure_cmd})
+      if defined $project->{configure_cmd};
 
   my @libs = qw{blib/lib};
   push @libs, @{$project->{libs}} if $project->{libs};
 
-  for my $libloc (@libs) {
-    my $libdir = File::Spec->catdir($tmpdir,
-                                    $project->{root_dir},
-                                    $libloc);
-    print "adding $libdir to \@INC\n";
-    unshift @{$self->_added_to_inc}, $libdir;
-    unshift @INC, $libdir;
-  }
-
+  @libs = map {File::Spec->catdir($tmpdir, $project->{root_dir}, $_)} @libs;
 
-  return $projectdir;
+  return @libs;
 }
 
 sub _list_dbs {



More information about the Bps-public-commit mailing list