r72668 - in /branches/upstream/libextutils-cchecker-perl/current: Build.PL Changes MANIFEST META.yml README lib/ExtUtils/CChecker.pm t/02assert.t t/04module_build.t t/05defines_to.t
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Sat Apr 16 14:02:15 UTC 2011
Author: periapt-guest
Date: Sat Apr 16 14:01:46 2011
New Revision: 72668
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72668
Log:
[svn-upgrade] new version libextutils-cchecker-perl (0.07)
Added:
branches/upstream/libextutils-cchecker-perl/current/t/05defines_to.t
Modified:
branches/upstream/libextutils-cchecker-perl/current/Build.PL
branches/upstream/libextutils-cchecker-perl/current/Changes
branches/upstream/libextutils-cchecker-perl/current/MANIFEST
branches/upstream/libextutils-cchecker-perl/current/META.yml
branches/upstream/libextutils-cchecker-perl/current/README
branches/upstream/libextutils-cchecker-perl/current/lib/ExtUtils/CChecker.pm
branches/upstream/libextutils-cchecker-perl/current/t/02assert.t
branches/upstream/libextutils-cchecker-perl/current/t/04module_build.t
Modified: branches/upstream/libextutils-cchecker-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/Build.PL?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/Build.PL (original)
+++ branches/upstream/libextutils-cchecker-perl/current/Build.PL Sat Apr 16 14:01:46 2011
@@ -10,7 +10,7 @@
},
build_requires => {
'Module::Build' => 0,
- 'Test::Exception' => 0,
+ 'Test::Fatal' => 0,
'Test::More' => 0,
},
license => 'perl',
Modified: branches/upstream/libextutils-cchecker-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/Changes?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/Changes (original)
+++ branches/upstream/libextutils-cchecker-perl/current/Changes Sat Apr 16 14:01:46 2011
@@ -1,4 +1,9 @@
Revision history for ExtUtils-CChecker
+
+0.07 CHANGES:
+ * Use Test::Fatal instead of Test::Exception
+ * Advise against calling it "config.h" as that gets confused with
+ core perl's file
0.06 CHANGES:
* Added 'defines_to' constructor arg for writing a "config.h" file
Modified: branches/upstream/libextutils-cchecker-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/MANIFEST?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/MANIFEST (original)
+++ branches/upstream/libextutils-cchecker-perl/current/MANIFEST Sat Apr 16 14:01:46 2011
@@ -11,4 +11,5 @@
t/02assert.t
t/03accessors.t
t/04module_build.t
+t/05defines_to.t
t/99pod.t
Modified: branches/upstream/libextutils-cchecker-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/META.yml?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/META.yml (original)
+++ branches/upstream/libextutils-cchecker-perl/current/META.yml Sat Apr 16 14:01:46 2011
@@ -4,7 +4,7 @@
- 'Paul Evans <leonerd at leonerd.org.uk>'
build_requires:
Module::Build: 0
- Test::Exception: 0
+ Test::Fatal: 0
Test::More: 0
configure_requires:
Module::Build: 0.36
@@ -17,9 +17,9 @@
provides:
ExtUtils::CChecker:
file: lib/ExtUtils/CChecker.pm
- version: 0.06
+ version: 0.07
requires:
ExtUtils::CBuilder: 0
resources:
license: http://dev.perl.org/licenses/
-version: 0.06
+version: 0.07
Modified: branches/upstream/libextutils-cchecker-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/README?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/README (original)
+++ branches/upstream/libextutils-cchecker-perl/current/README Sat Apr 16 14:01:46 2011
@@ -311,15 +311,18 @@
including the kernel headers, which should make the constant and
structure visible, allowing the program to compile.
- Creating a config.h
+ Creating an "#include" file
Sometimes, rather than setting defined symbols on the compiler
commandline, it is preferrable to have them written to a C preprocessor
- include (.h) file.
+ include (.h) file. This may be beneficial for cross-platform portability
+ concerns, as not all C compilers may take extra "-D" arguments on the
+ command line, or platforms may have small length restrictions on the
+ length of a command line.
use ExtUtils::CChecker;
my $cc = ExtUtils::CChecker->new(
- defines_to => "config.h",
+ defines_to => "mymodule-config.h",
);
$cc->try_compile_run(
@@ -327,7 +330,7 @@
source => <<'EOF' );
#include <mango.h>
#include <unistd.h>
- #include "config.h"
+ #include "mymodule-config.h"
int main(void) {
if(mango() != 0)
exit(1);
@@ -335,9 +338,14 @@
}
EOF
- Because the config.h file is written and flushed after every define
- operation, it will still be useable in later C fragments to test for
- features detected in earlier ones.
+ Because the mymodule-config.h file is written and flushed after every
+ define operation, it will still be useable in later C fragments to test
+ for features detected in earlier ones.
+
+ It is suggested not to name the file simply config.h, as the core of
+ Perl itself has a file of that name containing its own compile-time
+ detected configuration. A confusion between the two could lead to
+ surprising results.
AUTHOR
Paul Evans <leonerd at leonerd.org.uk>
Modified: branches/upstream/libextutils-cchecker-perl/current/lib/ExtUtils/CChecker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/lib/ExtUtils/CChecker.pm?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/lib/ExtUtils/CChecker.pm (original)
+++ branches/upstream/libextutils-cchecker-perl/current/lib/ExtUtils/CChecker.pm Sat Apr 16 14:01:46 2011
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.06';
+our $VERSION = '0.07';
use Carp;
@@ -527,11 +527,6 @@
return Module::Build->new( %args );
}
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
=head1 EXAMPLES
=head2 Socket Libraries
@@ -657,15 +652,18 @@
including the kernel headers, which should make the constant and structure
visible, allowing the program to compile.
-=head2 Creating a F<config.h>
+=head2 Creating an C<#include> file
Sometimes, rather than setting defined symbols on the compiler commandline, it
is preferrable to have them written to a C preprocessor include (F<.h>) file.
+This may be beneficial for cross-platform portability concerns, as not all C
+compilers may take extra C<-D> arguments on the command line, or platforms may
+have small length restrictions on the length of a command line.
use ExtUtils::CChecker;
my $cc = ExtUtils::CChecker->new(
- defines_to => "config.h",
+ defines_to => "mymodule-config.h",
);
$cc->try_compile_run(
@@ -673,7 +671,7 @@
source => <<'EOF' );
#include <mango.h>
#include <unistd.h>
- #include "config.h"
+ #include "mymodule-config.h"
int main(void) {
if(mango() != 0)
exit(1);
@@ -681,10 +679,18 @@
}
EOF
-Because the F<config.h> file is written and flushed after every define
-operation, it will still be useable in later C fragments to test for features
-detected in earlier ones.
+Because the F<mymodule-config.h> file is written and flushed after every
+define operation, it will still be useable in later C fragments to test for
+features detected in earlier ones.
+
+It is suggested not to name the file simply F<config.h>, as the core of Perl
+itself has a file of that name containing its own compile-time detected
+configuration. A confusion between the two could lead to surprising results.
=head1 AUTHOR
Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;
Modified: branches/upstream/libextutils-cchecker-perl/current/t/02assert.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/t/02assert.t?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/t/02assert.t (original)
+++ branches/upstream/libextutils-cchecker-perl/current/t/02assert.t Sat Apr 16 14:01:46 2011
@@ -2,19 +2,19 @@
use strict;
use Test::More tests => 2;
-use Test::Exception;
+use Test::Fatal;
use ExtUtils::CChecker;
my $cc = ExtUtils::CChecker->new;
-lives_ok(
- sub { $cc->assert_compile_run( source => "int main(void) { return 0; }\n", diag => "OK source" ); },
+ok(
+ !exception { $cc->assert_compile_run( source => "int main(void) { return 0; }\n", diag => "OK source" ); },
'Trivial C program'
);
-throws_ok(
- sub { $cc->assert_compile_run( source => "int foo bar splot\n", diag => "broken source" ); },
+like(
+ exception { $cc->assert_compile_run( source => "int foo bar splot\n", diag => "broken source" ); },
qr/^OS unsupported - broken source$/,
'Broken C program does not compile and run'
);
Modified: branches/upstream/libextutils-cchecker-perl/current/t/04module_build.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/t/04module_build.t?rev=72668&op=diff
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/t/04module_build.t (original)
+++ branches/upstream/libextutils-cchecker-perl/current/t/04module_build.t Sat Apr 16 14:01:46 2011
@@ -2,7 +2,6 @@
use strict;
use Test::More tests => 4;
-use Test::Exception;
use ExtUtils::CChecker;
Added: branches/upstream/libextutils-cchecker-perl/current/t/05defines_to.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-cchecker-perl/current/t/05defines_to.t?rev=72668&op=file
==============================================================================
--- branches/upstream/libextutils-cchecker-perl/current/t/05defines_to.t (added)
+++ branches/upstream/libextutils-cchecker-perl/current/t/05defines_to.t Sat Apr 16 14:01:46 2011
@@ -1,0 +1,27 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 5;
+
+use ExtUtils::CChecker;
+
+my $cc = ExtUtils::CChecker->new(
+ defines_to => "test-config.h",
+);
+
+END { -e "test-config.h" and unlink "test-config.h"; }
+
+ok( defined $cc, 'defined $cc' );
+isa_ok( $cc, "ExtUtils::CChecker", '$cc' );
+
+$cc->try_compile_run(
+ source => "int main(void) { return 0; }\n",
+ define => "HAVE_C",
+);
+
+is_deeply( $cc->extra_compiler_flags, [], 'extra_compiler_flags does not have -D' );
+
+ok( -e "test-config.h", 'test-config.h exists' );
+
+open my $fh, "<", "test-config.h" or die "Cannot read test-config.h - $!";
+is( scalar <$fh>, "#define HAVE_C /**/\n", 'test-config.h has #define HAVE_C' );
More information about the Pkg-perl-cvs-commits
mailing list