- write out the image size in bytes field of a BMP correctly.
http://rt.cpan.org/Ticket/Display.html?id=41406
+ - add limited tests for Imager::ExtUtils
+
+ - make Imager::ExtUtils->includes use an absolute path, since
+ a relative path could cause failures using Inline::C.
+ http://rt.cpan.org/Ticket/Display.html?id=37353
+
Imager 0.66 - 22 April 2008
===========
t/t80texttools.t Test text wrapping
t/t81hlines.t Test hlines.c
t/t82inline.t Test Inline::C integration
+t/t83extutil.t Test Imager::ExtUtils
t/t90cc.t
t/t91pod.t Test POD with Test::Pod
t/t92samples.t
package Imager::ExtUtils;
use strict;
+use File::Spec;
use vars qw($VERSION);
-$VERSION = "1.001";
+$VERSION = "1.002";
=head1 NAME
# figure out where Imager is installed
sub base_dir {
- for my $dir (@INC) {
- if (-e "$dir/Imager.pm") {
- return $dir;
+ for my $inc_dir (@INC) {
+ if (-e "$inc_dir/Imager.pm") {
+ my $base_dir = $inc_dir;
+ unless (File::Spec->file_name_is_absolute($base_dir)) {
+ $base_dir = File::Spec->rel2abs($base_dir);
+ }
+ return $base_dir;
}
}
--- /dev/null
+#!perl -w
+use strict;
+use Test::More tests => 6;
+use File::Spec;
+
+{ # RT 37353
+ local @INC = @INC;
+
+ unshift @INC, File::Spec->catdir('blib', 'lib');
+ unshift @INC, File::Spec->catdir('blib', 'arch');
+ require Imager::ExtUtils;
+ my $path = Imager::ExtUtils->base_dir;
+ ok(File::Spec->file_name_is_absolute($path), "check dirs absolute")
+ or print "# $path\n";
+}
+
+{ # includes
+ my $includes = Imager::ExtUtils->includes;
+ ok($includes =~ s/^-I//, "has the -I");
+ ok(-e File::Spec->catfile($includes, "imext.h"), "found a header");
+}
+
+{ # typemap
+ my $typemap = Imager::ExtUtils->typemap;
+ ok($typemap, "got a typemap path");
+ ok(-f $typemap, "it exists");
+ open TYPEMAP, "< $typemap";
+ my $tm_content = do { local $/; <TYPEMAP>; };
+ close TYPEMAP;
+ cmp_ok($tm_content, '=~', "Imager::Color\\s+T_PTROBJ",
+ "it seems to be the right file");
+}