develooper Front page | perl.perl5.porters | Postings from July 2009

[PATCH] Fixed failing test for ExtUtils::CBuilder.

Thread Previous | Thread Next
From:
David E . Wheeler
Date:
July 2, 2009 22:48
Subject:
[PATCH] Fixed failing test for ExtUtils::CBuilder.
Message ID:
578592AC-11D4-417D-9AE4-881DD8B9A023@kineticode.com
Not sure why this was committed, as it is not platform-specific. The  
path to
Perl, which is used to mock `cc`, was wrong, because the test is using  
`$^X`,
which is `./perl` during the tests, and the test changes away from the
directory containing `./perl`. Fixed by using `File::Spec->rel2abs` to  
find
the full path befor changing any directories.
---

This patch is against maint-5.10.

lib/ExtUtils/CBuilder/t/00-have-compiler.t |    8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/ExtUtils/CBuilder/t/00-have-compiler.t b/lib/ExtUtils/ 
CBuilder/t/00-have-compiler.t
index 1ba22f8..cf62e97 100644
--- a/lib/ExtUtils/CBuilder/t/00-have-compiler.t
+++ b/lib/ExtUtils/CBuilder/t/00-have-compiler.t
@@ -1,6 +1,9 @@
#! perl -w

+use File::Spec;
+my $perl;
BEGIN {
+  $perl = File::Spec->rel2abs($^X);
   if ($ENV{PERL_CORE}) {
     chdir 't' if -d 't';
     chdir '../lib/ExtUtils/CBuilder'
@@ -11,7 +14,6 @@ BEGIN {

use strict;
use Test::More;
-use File::Spec;
BEGIN {
   if ($^O eq 'VMS') {
     # So we can get the return value of system()
@@ -34,8 +36,8 @@ is( $b->have_compiler, 0, "have_compiler: fake  
missing cc" );

# test found compiler
$b->{have_compiler} = undef;
-$b->{config}{cc} = "$^X -e1 --";
-$b->{config}{ld} = "$^X -e1 --";
+$b->{config}{cc} = "$perl -e1 --";
+$b->{config}{ld} = "$perl -e1 --";
is( $b->have_compiler, 1, "have_compiler: fake present cc" );


-- 
1.6.3.1


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About