You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by ge...@apache.org on 2004/08/09 15:26:10 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestHarness.pm

geoff       2004/08/09 06:26:10

  Modified:    perl-framework/Apache-Test/lib/Apache TestHarness.pm
  Log:
  make sure that Apache-Test/lib can be found for external system calls
  when running from either perl-framework/ or Apache-Test/.  for the most
  part, this only affects whether all.t functions properly in both
  directories.
  
  Revision  Changes    Path
  1.19      +24 -2     httpd-test/perl-framework/Apache-Test/lib/Apache/TestHarness.pm
  
  Index: TestHarness.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestHarness.pm,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TestHarness.pm	4 Mar 2004 05:51:31 -0000	1.18
  +++ TestHarness.pm	9 Aug 2004 13:26:10 -0000	1.19
  @@ -63,8 +63,30 @@
   sub run_t {
       my($self, $file) = @_;
       my $ran = 0;
  -    my $lib = catfile Apache::Test::vars('top_dir'), qw(Apache-Test lib);
  -    my $cmd = qq[$^X -Mlib="$lib" $file];
  +
  +    my $source_lib = '';
  +
  +    if (Apache::TestConfig::IS_APACHE_TEST_BUILD) {
  +        # so we can find Apache/Test.pm from both the perl-framework/
  +        # and Apache-Test/
  +
  +        my $top_dir = Apache::Test::vars('top_dir');
  +
  +        foreach my $lib (catfile($top_dir, qw(Apache-Test lib)),
  +                         catfile($top_dir, 'lib')) {
  +
  +            if (-d $lib) {
  +
  +                info "adding source lib $lib to \@INC";
  +
  +                $source_lib = qq[-Mlib="$lib"];
  +
  +                last;
  +            }
  +        }
  +    }
  +    
  +    my $cmd = qq[$^X $source_lib $file];
   
       my $h = Symbol::gensym();
       open $h, "$cmd|" or die "open $cmd: $!";