r38959 - in /trunk/libextutils-cbuilder-perl: ./ debian/ lib/ExtUtils/ lib/ExtUtils/CBuilder/ lib/ExtUtils/CBuilder/Platform/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Jun 30 02:27:38 UTC 2009


Author: jawnsy-guest
Date: Tue Jun 30 02:27:32 2009
New Revision: 38959

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38959
Log:
* New upstream release
  + More test coverage
  + Tests code that checks if there's a compiler
  + Now falls back to compiling in the current working directory
* Added /me to Uploaders and d/copyright
* Rewrote the control description slightly
* It looks like the Makefile.PL is a traditional one, so Module::Build is not
  strictly necessary

Added:
    trunk/libextutils-cbuilder-perl/t/00-have-compiler.t
Modified:
    trunk/libextutils-cbuilder-perl/Build.PL
    trunk/libextutils-cbuilder-perl/Changes
    trunk/libextutils-cbuilder-perl/MANIFEST
    trunk/libextutils-cbuilder-perl/META.yml
    trunk/libextutils-cbuilder-perl/Makefile.PL
    trunk/libextutils-cbuilder-perl/README
    trunk/libextutils-cbuilder-perl/debian/changelog
    trunk/libextutils-cbuilder-perl/debian/control
    trunk/libextutils-cbuilder-perl/debian/copyright
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
    trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm
    trunk/libextutils-cbuilder-perl/t/01-basic.t
    trunk/libextutils-cbuilder-perl/t/02-link.t

Modified: trunk/libextutils-cbuilder-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/Build.PL?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/Build.PL (original)
+++ trunk/libextutils-cbuilder-perl/Build.PL Tue Jun 30 02:27:32 2009
@@ -12,6 +12,7 @@
   (
    module_name => 'ExtUtils::CBuilder',
    license => 'perl',
+   auto_configure_requires => 0,
    requires => {
 		'File::Basename' => 0,
 		'File::Spec' => 0,
@@ -20,7 +21,7 @@
 		'IO::File' => 0,
 	       },
    build_requires => {
-		      'Test' => 0,
+		      'Test::More' => 0.47,
 		     },
    create_makefile_pl => 'traditional',
    create_readme => 1,

Modified: trunk/libextutils-cbuilder-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/Changes?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/Changes (original)
+++ trunk/libextutils-cbuilder-perl/Changes Tue Jun 30 02:27:32 2009
@@ -1,4 +1,19 @@
 Revision history for Perl extension ExtUtils::CBuilder.
+
+0.26 - Mon Jun 29 20:11:52 EDT 2009
+
+ - No changes from 0.25_01
+
+0.25_01 - Sat Jun 27 23:13:20 EDT 2009
+
+ - Changed test library to Test::More
+
+ - Added tests for have_compiler
+
+ - Skips tests that need a compiler if have_compiler is false
+
+ - have_compiler will try to compile in the current directory
+   if compiling in tmpdir fails for whatever reason
 
 0.25 - Fri Jun 26 16:18:13 EDT 2009
 

Modified: trunk/libextutils-cbuilder-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/MANIFEST?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/MANIFEST (original)
+++ trunk/libextutils-cbuilder-perl/MANIFEST Tue Jun 30 02:27:32 2009
@@ -15,5 +15,6 @@
 MANIFEST			This list of files
 META.yml
 README
+t/00-have-compiler.t
 t/01-basic.t
 t/02-link.t

Modified: trunk/libextutils-cbuilder-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/META.yml?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/META.yml (original)
+++ trunk/libextutils-cbuilder-perl/META.yml Tue Jun 30 02:27:32 2009
@@ -1,6 +1,6 @@
 ---
 name: ExtUtils-CBuilder
-version: 0.25
+version: 0.26
 author:
   - 'Ken Williams, kwilliams at cpan.org'
 abstract: Compile and link C code for Perl modules
@@ -9,7 +9,7 @@
   license: http://dev.perl.org/licenses/
   repository: http://svn.perl.org/modules/ExtUtils-CBuilder
 build_requires:
-  Test: 0
+  Test::More: 0.47
 requires:
   Cwd: 0
   File::Basename: 0
@@ -19,19 +19,19 @@
 provides:
   ExtUtils::CBuilder:
     file: lib/ExtUtils/CBuilder.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Base:
     file: lib/ExtUtils/CBuilder/Base.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::Unix:
     file: lib/ExtUtils/CBuilder/Platform/Unix.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::VMS:
     file: lib/ExtUtils/CBuilder/Platform/VMS.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::Windows:
     file: lib/ExtUtils/CBuilder/Platform/Windows.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::Windows::BCC:
     file: lib/ExtUtils/CBuilder/Platform/Windows.pm
   ExtUtils::CBuilder::Platform::Windows::GCC:
@@ -40,20 +40,20 @@
     file: lib/ExtUtils/CBuilder/Platform/Windows.pm
   ExtUtils::CBuilder::Platform::aix:
     file: lib/ExtUtils/CBuilder/Platform/aix.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::cygwin:
     file: lib/ExtUtils/CBuilder/Platform/cygwin.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::darwin:
     file: lib/ExtUtils/CBuilder/Platform/darwin.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::dec_osf:
     file: lib/ExtUtils/CBuilder/Platform/dec_osf.pm
-    version: 0.25
+    version: 0.26
   ExtUtils::CBuilder::Platform::os2:
     file: lib/ExtUtils/CBuilder/Platform/os2.pm
-    version: 0.25
-generated_by: Module::Build version 0.3304
+    version: 0.26
+generated_by: Module::Build version 0.3305
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4

Modified: trunk/libextutils-cbuilder-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/Makefile.PL?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/Makefile.PL (original)
+++ trunk/libextutils-cbuilder-perl/Makefile.PL Tue Jun 30 02:27:32 2009
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.33_04
+# Note: this file was auto-generated by Module::Build::Compat version 0.33_05
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
@@ -8,10 +8,10 @@
           'EXE_FILES' => [],
           'VERSION_FROM' => 'lib/ExtUtils/CBuilder.pm',
           'PREREQ_PM' => {
+                           'Test::More' => '0.47',
                            'Text::ParseWords' => 0,
                            'IO::File' => 0,
                            'File::Spec' => 0,
-                           'Test' => 0,
                            'File::Basename' => 0,
                            'Cwd' => 0
                          }

Modified: trunk/libextutils-cbuilder-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/README?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/README (original)
+++ trunk/libextutils-cbuilder-perl/README Tue Jun 30 02:27:32 2009
@@ -34,7 +34,8 @@
     have_compiler
         Returns true if the current system has a working C compiler and
         linker, false otherwise. To determine this, we actually compile and
-        link a sample C library.
+        link a sample C library. The sample will be compiled in the system
+        tempdir or, if that fails for some reason, in the current directory.
 
     compile
         Compiles a C source file and produces an object file. The name of

Modified: trunk/libextutils-cbuilder-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/changelog?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/changelog (original)
+++ trunk/libextutils-cbuilder-perl/debian/changelog Tue Jun 30 02:27:32 2009
@@ -1,3 +1,16 @@
+libextutils-cbuilder-perl (0.26-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    + More test coverage
+    + Tests code that checks if there's a compiler
+    + Now falls back to compiling in the current working directory
+  * Added /me to Uploaders and d/copyright
+  * Rewrote the control description slightly
+  * It looks like the Makefile.PL is a traditional one, so Module::Build is not
+    strictly necessary
+
+ -- Jonathan Yu <frequency at cpan.org>  Mon, 29 Jun 2009 18:10:28 -0400
+
 libextutils-cbuilder-perl (0.25-1) unstable; urgency=low
 
   [ gregor herrmann ]

Modified: trunk/libextutils-cbuilder-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/control?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/control (original)
+++ trunk/libextutils-cbuilder-perl/debian/control Tue Jun 30 02:27:32 2009
@@ -1,11 +1,11 @@
 Source: libextutils-cbuilder-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7), perl-modules (>= 5.10) | libmodule-build-perl
+Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: perl (>= 5.8.0-7)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Damyan Ivanov <dmn at debian.org>,
- gregor herrmann <gregoa at debian.org>, Nathan Handler <nhandler at ubuntu.com>
+Uploaders: Damyan Ivanov <dmn at debian.org>, gregor herrmann <gregoa at debian.org>,
+ Nathan Handler <nhandler at ubuntu.com>, Jonathan Yu <frequency at cpan.org>
 Standards-Version: 3.8.2
 Homepage: http://search.cpan.org/dist/ExtUtils-CBuilder/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libextutils-cbuilder-perl/
@@ -14,12 +14,12 @@
 Package: libextutils-cbuilder-perl
 Architecture: all
 Depends: ${perl:Depends}, ${misc:Depends}
-Description: module to compile and link C code for Perl modules
- ExtUtils::CBuilder module can build the C portions of Perl modules by
- invoking the appropriate compilers and linkers in a cross-platform manner.
- It was motivated by the Module::Build project, but may be useful for other
- purposes as well.
+Description: Perl utility to compile and link C code for Perl modules
+ ExtUtils::CBuilder is a utility to portably build C code by invoking the
+ appropriate compilers and linkers. It provides a cross-platform way to build
+ Perl XS modules, which contain C code that needs to be built and dynamically
+ linked to Perl.
  .
- However, this module is not intended as a general cross-platform
- interface to all your C building needs.  That would have been a much
- more ambitious goal!
+ Though motivated by the Module::Build project, it may be useful for other
+ purposes as well. However, this module is not intended as a general interface
+ for all C building needs.

Modified: trunk/libextutils-cbuilder-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/debian/copyright?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/debian/copyright (original)
+++ trunk/libextutils-cbuilder-perl/debian/copyright Tue Jun 30 02:27:32 2009
@@ -5,14 +5,15 @@
 Upstream-Name: ExtUtils-CBuilder
 
 Files: *
-Copyright: (c) 2003-2005 Ken Williams <kwilliams at cpan.org>
+Copyright: 2003-2005, Ken Williams <kwilliams at cpan.org>
 License-Alias: Perl
 License: Artistic | GPL-1+
 
 Files: debian/*
-Copyright: 2005, Chip Salzenberg <chip at debian.org>,
- 2006, Florian Ragwitz <rafl at debian.org>,
+Copyright: 2009, Jonathan Yu <frequency at cpan.org>
  2008-2009, various members of the Debian Perl Group, cf. debian/changelog
+ 2006, Florian Ragwitz <rafl at debian.org>
+ 2005, Chip Salzenberg <chip at debian.org>
 License: Artistic | GPL-1+
 
 License: Artistic

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder.pm Tue Jun 30 02:27:32 2009
@@ -5,7 +5,7 @@
 use File::Basename ();
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 $VERSION = eval $VERSION;
 
 # Okay, this is the brute-force method of finding out what kind of
@@ -130,7 +130,8 @@
 
 Returns true if the current system has a working C compiler and
 linker, false otherwise.  To determine this, we actually compile and
-link a sample C library.
+link a sample C library.  The sample will be compiled in the system
+tempdir or, if that fails for some reason, in the current directory.
 
 =item compile
 

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Base.pm Tue Jun 30 02:27:32 2009
@@ -9,7 +9,7 @@
 use IO::File;
 
 use vars qw($VERSION);
-$VERSION = '0.25';
+$VERSION = '0.26';
 
 sub new {
   my $class = shift;
@@ -116,25 +116,40 @@
 sub have_compiler {
   my ($self) = @_;
   return $self->{have_compiler} if defined $self->{have_compiler};
-  
-  my $tmpfile = File::Spec->catfile(File::Spec->tmpdir, 'compilet.c');
-  {
-    my $FH = IO::File->new("> $tmpfile") or die "Can't create $tmpfile: $!";
-    print $FH "int boot_compilet() { return 1; }\n";
-  }
-
-  my ($obj_file, @lib_files);
-  eval {
-    $obj_file = $self->compile(source => $tmpfile);
-    @lib_files = $self->link(objects => $obj_file, module_name => 'compilet');
-  };
-  warn $@ if $@;
-  my $result = $self->{have_compiler} = $@ ? 0 : 1;
-  
-  foreach (grep defined, $tmpfile, $obj_file, @lib_files) {
-    1 while unlink;
-  }
-  return $result;
+
+  my $result;
+  my $attempts = 3;
+  # tmpdir has issues for some people so fall back to current dir
+  DIR: for my $dir ( File::Spec->tmpdir, '.' ) {
+
+    # don't clobber existing files (rare, but possible)
+    my $rand = int(rand(2**31));
+    my $tmpfile = File::Spec->catfile($dir, "compilet-$rand.c");
+    if ( -e $tmpfile ) {
+      redo DIR if $attempts--;
+      next DIR;
+    }
+
+    {
+      my $FH = IO::File->new("> $tmpfile") or die "Can't create $tmpfile: $!";
+      print $FH "int boot_compilet() { return 1; }\n";
+    }
+
+    my ($obj_file, @lib_files);
+    eval {
+      local $^W = 0;
+      $obj_file = $self->compile(source => $tmpfile);
+      @lib_files = $self->link(objects => $obj_file, module_name => 'compilet');
+    };
+    $result = $@ ? 0 : 1;
+
+    foreach (grep defined, $tmpfile, $obj_file, @lib_files) {
+      1 while unlink;
+    }
+    last DIR if $result;
+  }
+
+  return $self->{have_compiler} = $result;
 }
 
 sub lib_file {

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Unix.pm Tue Jun 30 02:27:32 2009
@@ -4,7 +4,7 @@
 use ExtUtils::CBuilder::Base;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Base);
 
 sub link_executable {

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/VMS.pm Tue Jun 30 02:27:32 2009
@@ -4,7 +4,7 @@
 use ExtUtils::CBuilder::Base;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Base);
 
 use File::Spec::Functions qw(catfile catdir);

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/Windows.pm Tue Jun 30 02:27:32 2009
@@ -10,7 +10,7 @@
 use IO::File;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Base);
 
 sub new {

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/aix.pm Tue Jun 30 02:27:32 2009
@@ -5,7 +5,7 @@
 use File::Spec;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub need_prelink { 1 }

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/cygwin.pm Tue Jun 30 02:27:32 2009
@@ -5,7 +5,7 @@
 use ExtUtils::CBuilder::Platform::Unix;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub link_executable {

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/darwin.pm Tue Jun 30 02:27:32 2009
@@ -4,7 +4,7 @@
 use ExtUtils::CBuilder::Platform::Unix;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub compile {

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/dec_osf.pm Tue Jun 30 02:27:32 2009
@@ -6,7 +6,7 @@
 
 use vars qw($VERSION @ISA);
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
-$VERSION = '0.25';
+$VERSION = '0.26';
 
 sub link_executable {
   my $self = shift;

Modified: trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm (original)
+++ trunk/libextutils-cbuilder-perl/lib/ExtUtils/CBuilder/Platform/os2.pm Tue Jun 30 02:27:32 2009
@@ -4,7 +4,7 @@
 use ExtUtils::CBuilder::Platform::Unix;
 
 use vars qw($VERSION @ISA);
-$VERSION = '0.25';
+$VERSION = '0.26';
 @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
 
 sub need_prelink { 1 }

Added: trunk/libextutils-cbuilder-perl/t/00-have-compiler.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/00-have-compiler.t?rev=38959&op=file
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/00-have-compiler.t (added)
+++ trunk/libextutils-cbuilder-perl/t/00-have-compiler.t Tue Jun 30 02:27:32 2009
@@ -1,0 +1,41 @@
+#! perl -w
+
+BEGIN {
+  if ($ENV{PERL_CORE}) {
+    chdir 't' if -d 't';
+    chdir '../lib/ExtUtils/CBuilder'
+      or die "Can't chdir to lib/ExtUtils/CBuilder: $!";
+    @INC = qw(../..);
+  }
+}
+
+use strict;
+use Test::More;
+use File::Spec;
+BEGIN { 
+  if ($^O eq 'VMS') {
+    # So we can get the return value of system()
+    require vmsish;
+    import vmsish;
+  }
+}
+
+plan tests => 4;
+
+require_ok "ExtUtils::CBuilder";
+
+my $b = eval { ExtUtils::CBuilder->new(quiet => 1) };
+ok( $b, "got CBuilder object" ) or diag $@;
+
+# test missing compiler
+$b->{config}{cc} = 'djaadjfkadjkfajdf';
+$b->{config}{ld} = 'djaadjfkadjkfajdf';
+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 --";
+is( $b->have_compiler, 1, "have_compiler: fake present cc" );
+
+

Modified: trunk/libextutils-cbuilder-perl/t/01-basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/01-basic.t?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/01-basic.t (original)
+++ trunk/libextutils-cbuilder-perl/t/01-basic.t Tue Jun 30 02:27:32 2009
@@ -10,42 +10,56 @@
 }
 
 use strict;
-use Test;
-BEGIN { plan tests => 11 }
-
+use Test::More;
+BEGIN { 
+  if ($^O eq 'VMS') {
+    # So we can get the return value of system()
+    require vmsish;
+    import vmsish;
+  }
+}
 use ExtUtils::CBuilder;
 use File::Spec;
-ok 1;
 
 # TEST doesn't like extraneous output
 my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
+my ($source_file, $object_file, $lib_file);
 
 my $b = ExtUtils::CBuilder->new(quiet => $quiet);
-ok $b;
 
-ok $b->have_compiler;
+# test plan
+if ( ! $b->have_compiler ) {
+  plan skip_all => "no compiler available for testing";
+}
+else {
+  plan tests => 10;
+}
 
-my $source_file = File::Spec->catfile('t', 'compilet.c');
+ok $b, "created EU::CB object";
+
+ok $b->have_compiler, "have_compiler";
+
+$source_file = File::Spec->catfile('t', 'compilet.c');
 {
   local *FH;
   open FH, "> $source_file" or die "Can't create $source_file: $!";
   print FH "int boot_compilet(void) { return 1; }\n";
   close FH;
 }
-ok -e $source_file;
+ok -e $source_file, "source file '$source_file' created";
 
-my $object_file = $b->object_file($source_file);
+$object_file = $b->object_file($source_file);
 ok 1;
 
-ok $object_file, $b->compile(source => $source_file);
+is $object_file, $b->compile(source => $source_file);
 
-my $lib_file = $b->lib_file($object_file);
+$lib_file = $b->lib_file($object_file);
 ok 1;
 
 my ($lib, @temps) = $b->link(objects => $object_file,
                              module_name => 'compilet');
 $lib =~ tr/"'//d;
-ok $lib_file, $lib;
+is $lib_file, $lib;
 
 for ($source_file, $object_file, $lib_file) {
   tr/"'//d;
@@ -54,15 +68,9 @@
 
 my @words = $b->split_like_shell(' foo bar');
 
-skip(
-    $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0,  # whether to skip
-    @words, 2
-  );
-skip(
-    $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0,  # whether to skip
-    $words[0], 'foo'
-);
-skip(
-    $^O =~ m/MSWin/ ? "Skip under MSWindows" : 0,  # whether to skip
-    $words[1], 'bar'
-);
+SKIP: {
+  skip "MSWindows", 3 if $^O =~ m/MSWin/;
+  is( @words, 2 );
+  is( $words[0], 'foo' );
+  is( $words[1], 'bar' );
+}

Modified: trunk/libextutils-cbuilder-perl/t/02-link.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libextutils-cbuilder-perl/t/02-link.t?rev=38959&op=diff
==============================================================================
--- trunk/libextutils-cbuilder-perl/t/02-link.t (original)
+++ trunk/libextutils-cbuilder-perl/t/02-link.t Tue Jun 30 02:27:32 2009
@@ -10,60 +10,74 @@
 }
 
 use strict;
-use Test;
+use Test::More;
 BEGIN { 
-  if ($^O eq 'MSWin32') {
-    print "1..0 # Skipped: link_executable() is not implemented yet on Win32\n";
-    exit;
-  }
   if ($^O eq 'VMS') {
     # So we can get the return value of system()
     require vmsish;
     import vmsish;
   }
-  plan tests => 5;
 }
-
 use ExtUtils::CBuilder;
 use File::Spec;
 
 # TEST doesn't like extraneous output
 my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
+my ($source_file, $object_file, $exe_file);
 
 my $b = ExtUtils::CBuilder->new(quiet => $quiet);
-ok $b;
 
-my $source_file = File::Spec->catfile('t', 'compilet.c');
+# test plan
+if ($^O eq 'MSWin32') {
+  plan skip_all => "link_executable() is not implemented yet on Win32";
+}
+elsif ( ! $b->have_compiler ) {
+  plan skip_all => "no compiler available for testing";
+}
+else {
+  plan tests => 7;
+}
+
+ok $b, "created EU::CB object";
+
+$source_file = File::Spec->catfile('t', 'compilet.c');
 {
   local *FH;
   open FH, "> $source_file" or die "Can't create $source_file: $!";
   print FH "int main(void) { return 11; }\n";
   close FH;
 }
-ok -e $source_file;
+ok -e $source_file, "generated '$source_file'";
 
 # Compile
-my $object_file;
-ok $object_file = $b->compile(source => $source_file);
+eval { $object_file = $b->compile(source => $source_file) };
+is $@, q{}, "no exception from compilation";
+ok -e $object_file, "found object file";
 
 # Link
-my ($exe_file, @temps);
-($exe_file, @temps) = $b->link_executable(objects => $object_file);
-ok -e $exe_file;
+SKIP: {
+  skip "error compiling source", 3
+    unless -e $object_file;
 
-if ($^O eq 'os2') {		# Analogue of LDLOADPATH...
-	# Actually, not needed now, since we do not link with the generated DLL
-  my $old = OS2::extLibpath();	# [builtin function]
-  $old = ";$old" if defined $old and length $old;
-  # To pass the sanity check, components must have backslashes...
-  OS2::extLibpath_set(".\\$old");
+  my @temps;
+  eval { ($exe_file, @temps) = $b->link_executable(objects => $object_file) };
+  is $@, q{}, "no exception from linking";
+  ok -e $exe_file, "found executable file";
+
+  if ($^O eq 'os2') {		# Analogue of LDLOADPATH...
+          # Actually, not needed now, since we do not link with the generated DLL
+    my $old = OS2::extLibpath();	# [builtin function]
+    $old = ";$old" if defined $old and length $old;
+    # To pass the sanity check, components must have backslashes...
+    OS2::extLibpath_set(".\\$old");
+  }
+
+  # Try the executable
+  my $ec = my_system($exe_file);
+  is $ec, 11, "got expected exit code from executable"
+    or print( $? == -1 ? "# Could not run '$exe_file'\n" 
+                      : "# Unexpected exit code '$ec'\n");
 }
-
-# Try the executable
-my $ec = my_system($exe_file);
-ok $ec, 11
-  or print( $? == -1 ? "# Could not run '$exe_file'\n" 
-                     : "# Unexpected exit code '$ec'\n");
 
 # Clean up
 for ($source_file, $object_file, $exe_file) {




More information about the Pkg-perl-cvs-commits mailing list