From: Tony Cook Date: Thu, 3 Feb 2011 09:25:53 +0000 (+1100) Subject: RT#65088 make sure each test script that needs testout/ creates it X-Git-Tag: Imager-0.81~10 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/40e78f965775d11d65467504c3d66004a31bfa42 RT#65088 make sure each test script that needs testout/ creates it --- diff --git a/Changes b/Changes index 12b62a7d..4c35aee3 100644 --- a/Changes +++ b/Changes @@ -27,6 +27,9 @@ Bug fixes: https://rt.cpan.org/Ticket/Display.html?id=65386 https://rt.cpan.org/Ticket/Display.html?id=62855 + - make sure each test script that needs testout/ creates it. + https://rt.cpan.org/Ticket/Display.html?id=65088 + Imager 0.80 - 17 Jan 2011 =========== diff --git a/GIF/t/t20new.t b/GIF/t/t20new.t index f68d9a29..c1082e36 100644 --- a/GIF/t/t20new.t +++ b/GIF/t/t20new.t @@ -14,6 +14,8 @@ use Test::More tests => 21; use Imager qw(:all :handy); use Imager::Test qw(test_image is_color3); +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t70newgif.log'); my $green=i_color_new(0,255,0,0); diff --git a/ICO/t/t70icosing.t b/ICO/t/t70icosing.t index 8327e47f..a1fe2325 100644 --- a/ICO/t/t70icosing.t +++ b/ICO/t/t70icosing.t @@ -4,7 +4,9 @@ use Test::More tests => 1; use Imager; use Imager::Test qw(test_image); +-d "testout" or mkdir "testout"; # checks that we load the ICO write handler automatically + my $img = test_image(); ok($img->write(file => 'testout/icosing.ico'), "write ico with autoload") diff --git a/ICO/t/t71icomult.t b/ICO/t/t71icomult.t index f602c456..55a69f35 100644 --- a/ICO/t/t71icomult.t +++ b/ICO/t/t71icomult.t @@ -4,6 +4,8 @@ use Test::More tests => 1; use Imager; use Imager::Test qw(test_image); +-d "testout" or mkdir "testout"; + # checks that we load the ICO write handler automatically my $img = test_image(); ok(Imager->write_multi({ file => 'testout/icomult.ico' }, $img, $img), diff --git a/ICO/t/t72cursing.t b/ICO/t/t72cursing.t index 8a174247..9fb33fc1 100644 --- a/ICO/t/t72cursing.t +++ b/ICO/t/t72cursing.t @@ -4,6 +4,8 @@ use Test::More tests => 1; use Imager; use Imager::Test qw(test_image); +-d "testout" or mkdir "testout"; + # checks that we load the CUR write handler automatically my $img = test_image(); ok($img->write(file => 'testout/cursing.cur'), diff --git a/ICO/t/t73curmult.t b/ICO/t/t73curmult.t index d0248bda..e17d0d48 100644 --- a/ICO/t/t73curmult.t +++ b/ICO/t/t73curmult.t @@ -4,6 +4,8 @@ use Test::More tests => 1; use Imager; use Imager::Test qw(test_image); +-d "testout" or mkdir "testout"; + # checks that we load the CUR write handler automatically my $img = test_image(); ok(Imager->write_multi({ file => 'testout/icomult.cur' }, $img, $img), diff --git a/t/t01introvert.t b/t/t01introvert.t index c0f3baf3..6d7cf756 100644 --- a/t/t01introvert.t +++ b/t/t01introvert.t @@ -9,6 +9,8 @@ BEGIN { use_ok(Imager => qw(:handy :all)) } use Imager::Test qw(image_bounds_checks is_color3 is_color4 is_fcolor4 color_cmp mask_tests); +-d "testout" or mkdir "testout"; + init_log("testout/t01introvert.log",1); my $im_g = Imager::ImgRaw::new(100, 101, 1); diff --git a/t/t020masked.t b/t/t020masked.t index eca923f9..092624ed 100644 --- a/t/t020masked.t +++ b/t/t020masked.t @@ -3,6 +3,9 @@ use strict; use Test::More tests => 142; use Imager qw(:all :handy); use Imager::Test qw(is_color3 is_fcolor3); + +-d "testout" or mkdir "testout"; + init_log("testout/t020masked.log", 1); my $base_rgb = Imager::ImgRaw::new(100, 100, 3); diff --git a/t/t021sixteen.t b/t/t021sixteen.t index abcfcd6b..14682615 100644 --- a/t/t021sixteen.t +++ b/t/t021sixteen.t @@ -4,6 +4,8 @@ use Test::More tests => 104; BEGIN { use_ok(Imager=>qw(:all :handy)) } +-d "testout" or mkdir "testout"; + init_log("testout/t021sixteen.log", 1); use Imager::Color::Float; diff --git a/t/t022double.t b/t/t022double.t index c2ec6840..fa2e07b9 100644 --- a/t/t022double.t +++ b/t/t022double.t @@ -4,6 +4,8 @@ use Test::More tests => 83; BEGIN { use_ok(Imager => qw(:all :handy)) } +-d "testout" or mkdir "testout"; + init_log("testout/t022double.log", 1); use Imager::Test qw(image_bounds_checks test_colorf_gpix test_colorf_glin mask_tests); diff --git a/t/t05error.t b/t/t05error.t index 89635c43..caf3fd9f 100644 --- a/t/t05error.t +++ b/t/t05error.t @@ -3,6 +3,9 @@ END { print "not ok 1\n" unless $loaded; }; use Imager qw(:all); ++$loaded; print "ok 1\n"; + +-d "testout" or mkdir "testout"; + init_log("testout/t05error.log", 1); # try to read an invalid pnm file diff --git a/t/t07iolayer.t b/t/t07iolayer.t index 4f747f53..111fac63 100644 --- a/t/t07iolayer.t +++ b/t/t07iolayer.t @@ -6,6 +6,8 @@ use IO::Seekable; BEGIN { use_ok(Imager => ':all') }; +-d "testout" or mkdir "testout"; + init_log("testout/t07iolayer.log", 1); undef($/); diff --git a/t/t1000files.t b/t/t1000files.t index 00380a02..2cf0a7c0 100644 --- a/t/t1000files.t +++ b/t/t1000files.t @@ -7,6 +7,8 @@ use strict; use Test::More tests => 35; use Imager; +-d "testout" or mkdir "testout"; + Imager::init_log("testout/t1000files.log", 1); SKIP: diff --git a/t/t101nojpeg.t b/t/t101nojpeg.t index 24b632d6..5f47a80a 100644 --- a/t/t101nojpeg.t +++ b/t/t101nojpeg.t @@ -3,6 +3,8 @@ use strict; use Test::More; use Imager qw(:all); +-d "testout" or mkdir "testout"; + init_log("testout/t101jpeg.log",1); $Imager::formats{"jpeg"} diff --git a/t/t103raw.t b/t/t103raw.t index 5f55514c..440c546e 100644 --- a/t/t103raw.t +++ b/t/t103raw.t @@ -3,6 +3,9 @@ use strict; use Test::More tests => 47; use Imager qw(:all); use Imager::Test qw/is_color3 is_color4/; + +-d "testout" or mkdir "testout"; + init_log("testout/t103raw.log",1); $| = 1; diff --git a/t/t104ppm.t b/t/t104ppm.t index ebe319c3..0f9d8581 100644 --- a/t/t104ppm.t +++ b/t/t104ppm.t @@ -4,6 +4,8 @@ use Test::More tests => 191; use strict; use Imager::Test qw(test_image_raw test_image_16 is_color3 is_color1 is_image); +-d "testout" or mkdir "testout"; + init_log("testout/t104ppm.log",1); my $green = i_color_new(0,255,0,255); diff --git a/t/t107bmp.t b/t/t107bmp.t index e8db5da0..73fae3f7 100644 --- a/t/t107bmp.t +++ b/t/t107bmp.t @@ -3,6 +3,9 @@ use strict; use Test::More tests => 213; use Imager qw(:all); use Imager::Test qw(test_image_raw is_image is_color3 test_image); + +-d "testout" or mkdir "testout"; + init_log("testout/t107bmp.log",1); my $debug_writes = 0; diff --git a/t/t108tga.t b/t/t108tga.t index ca6d02ba..fd502c00 100644 --- a/t/t108tga.t +++ b/t/t108tga.t @@ -3,8 +3,10 @@ use Imager qw(:all); use strict; use Test::More tests=>46; use Imager::Test qw(is_color4 is_image); -init_log("testout/t108tga.log",1); +-d "testout" or mkdir "testout"; + +init_log("testout/t108tga.log",1); my $img = create_test_image(); my $base_diff = 0; diff --git a/t/t15color.t b/t/t15color.t index 7b03dc41..ba46edda 100644 --- a/t/t15color.t +++ b/t/t15color.t @@ -12,6 +12,8 @@ use Test::More tests => 70; use Imager; use Imager::Test qw(is_fcolor4); +-d "testout" or mkdir "testout"; + init_log("testout/t15color.log",1); my $c1 = Imager::Color->new(100, 150, 200, 250); diff --git a/t/t20fill.t b/t/t20fill.t index 5508d51e..e060b0fa 100644 --- a/t/t20fill.t +++ b/t/t20fill.t @@ -8,6 +8,8 @@ use Imager::Color::Float; use Imager::Test qw(is_image is_color4 is_fcolor4 is_color3); use Config; +-d "testout" or mkdir "testout"; + Imager::init_log("testout/t20fill.log", 1); my $blue = NC(0,0,255); diff --git a/t/t21draw.t b/t/t21draw.t index eed43e63..0fb5b2e5 100644 --- a/t/t21draw.t +++ b/t/t21draw.t @@ -5,6 +5,8 @@ use Imager ':all'; use Imager::Test qw(is_color3 is_image); use constant PI => 3.14159265358979; +-d "testout" or mkdir "testout"; + init_log("testout/t21draw.log",1); my $redobj = NC(255, 0, 0); diff --git a/t/t22flood.t b/t/t22flood.t index 695fed7f..767cbab8 100644 --- a/t/t22flood.t +++ b/t/t22flood.t @@ -4,6 +4,8 @@ use Test::More tests => 15; use Imager; use Imager::Test qw(is_image); +-d "testout" or mkdir "testout"; + { # flood_fill wouldn't fill to the right if the area was just a # single scan-line my $im = Imager->new(xsize => 5, ysize => 3); diff --git a/t/t30t1font.t b/t/t30t1font.t index da5b5863..c24c0937 100644 --- a/t/t30t1font.t +++ b/t/t30t1font.t @@ -19,6 +19,8 @@ i_has_format("t1") plan tests => 95; +-d "testout" or mkdir "testout"; + init_log("testout/t30t1font.log",1); my $deffont = 'fontfiles/dcr10.pfb'; diff --git a/t/t35ttfont.t b/t/t35ttfont.t index aa512cb3..256b6bd9 100644 --- a/t/t35ttfont.t +++ b/t/t35ttfont.t @@ -7,6 +7,8 @@ $|=1; BEGIN { use_ok(Imager => ':all') } use Imager::Test qw(diff_text_with_nul is_color3); +-d "testout" or mkdir "testout"; + init_log("testout/t35ttfont.log",2); SKIP: diff --git a/t/t36oofont.t b/t/t36oofont.t index eb7965cc..3038b743 100644 --- a/t/t36oofont.t +++ b/t/t36oofont.t @@ -14,6 +14,8 @@ use Test::More tests => 20; BEGIN { use_ok('Imager') }; +-d "testout" or mkdir "testout"; + init_log("testout/t36oofont.log", 1); my $fontname_tt=$ENV{'TTFONTTEST'}||'./fontfiles/dodge.ttf'; diff --git a/t/t40scale.t b/t/t40scale.t index f1d32a94..7e2a149b 100644 --- a/t/t40scale.t +++ b/t/t40scale.t @@ -5,6 +5,8 @@ use Test::More tests => 232; BEGIN { use_ok(Imager=>':all') } use Imager::Test qw(is_image is_color4 is_image_similar); +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t40scale.log'); my $img=Imager->new(); diff --git a/t/t50basicoo.t b/t/t50basicoo.t index 2ea9f14e..994032fe 100644 --- a/t/t50basicoo.t +++ b/t/t50basicoo.t @@ -11,6 +11,8 @@ use IO::Seekable; my $buggy_giflib_file = "buggy_giflib.txt"; +-d "testout" or mkdir "testout"; + Imager::init("log"=>"testout/t50basicoo.log"); # single image/file types diff --git a/t/t55trans.t b/t/t55trans.t index 7aa2462b..2c84ce7b 100644 --- a/t/t55trans.t +++ b/t/t55trans.t @@ -6,6 +6,8 @@ $loaded = 1; #$Imager::DEBUG=1; +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t55trans.log'); $img=Imager->new() || die "unable to create image object\n"; diff --git a/t/t58trans2.t b/t/t58trans2.t index 46db20a5..eca36381 100644 --- a/t/t58trans2.t +++ b/t/t58trans2.t @@ -4,6 +4,8 @@ use Test::More tests => 37; BEGIN { use_ok('Imager'); } use Imager::Test qw(is_color3); +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t58trans2.log'); my $im1 = Imager->new(); diff --git a/t/t61filters.t b/t/t61filters.t index 2c1f16af..b9e00054 100644 --- a/t/t61filters.t +++ b/t/t61filters.t @@ -2,6 +2,9 @@ use strict; use Imager qw(:handy); use Test::More tests => 113; + +-d "testout" or mkdir "testout"; + Imager::init_log("testout/t61filters.log", 1); use Imager::Test qw(is_image_similar test_image is_image is_color4 is_fcolor4); # meant for testing the filters themselves diff --git a/t/t64copyflip.t b/t/t64copyflip.t index e8229335..58a6ff94 100644 --- a/t/t64copyflip.t +++ b/t/t64copyflip.t @@ -6,6 +6,8 @@ use Imager::Test qw(is_color3 is_image is_imaged test_image_double test_image is #$Imager::DEBUG=1; +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t64copyflip.log'); my $img=Imager->new() or die "unable to create image object\n"; diff --git a/t/t65crop.t b/t/t65crop.t index 627a86b1..3adaa151 100644 --- a/t/t65crop.t +++ b/t/t65crop.t @@ -6,6 +6,8 @@ use Imager::Test qw(test_image); #$Imager::DEBUG=1; +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t65crop.log'); my $img=Imager->new() || die "unable to create image object\n"; diff --git a/t/t66paste.t b/t/t66paste.t index 160a5147..c8f1f377 100644 --- a/t/t66paste.t +++ b/t/t66paste.t @@ -7,6 +7,8 @@ use Imager::Test qw(is_image); #$Imager::DEBUG=1; +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t66paste.log'); # the original smoke tests diff --git a/t/t67convert.t b/t/t67convert.t index fe894016..94e2a961 100644 --- a/t/t67convert.t +++ b/t/t67convert.t @@ -4,6 +4,8 @@ use Imager qw(:all :handy); use Test::More tests => 27; use Imager::Test qw(test_colorf_gpix is_fcolor1 is_fcolor3); +-d "testout" or mkdir "testout"; + Imager::init("log"=>'testout/t67convert.log'); my $imbase = Imager::ImgRaw::new(200,300,3); diff --git a/t/t68map.t b/t/t68map.t index ce225c52..600887de 100644 --- a/t/t68map.t +++ b/t/t68map.t @@ -1,3 +1,5 @@ +-d "testout" or mkdir "testout"; + Imager::init("log"=>'testout/t68map.log'); use Imager qw(:all :handy); diff --git a/t/t69rubthru.t b/t/t69rubthru.t index 447c3eb6..ae78d1c6 100644 --- a/t/t69rubthru.t +++ b/t/t69rubthru.t @@ -4,6 +4,8 @@ use Test::More tests => 76; use Imager qw(:all :handy); use Imager::Test qw(is_image); +-d "testout" or mkdir "testout"; + init_log("testout/t69rubthru.log", 1); my $src_height = 80; diff --git a/t/t75polyaa.t b/t/t75polyaa.t index 73068e24..ace2e64b 100644 --- a/t/t75polyaa.t +++ b/t/t75polyaa.t @@ -8,6 +8,8 @@ use Imager::Test qw(is_image is_color3); sub PI () { 3.14159265358979323846 } +-d "testout" or mkdir "testout"; + Imager::init_log("testout/t75aapolyaa.log",1); my $red = Imager::Color->new(255,0,0); diff --git a/t/t80texttools.t b/t/t80texttools.t index 4a4c323a..1dff6ee6 100644 --- a/t/t80texttools.t +++ b/t/t80texttools.t @@ -4,6 +4,8 @@ use Test::More tests => 13; BEGIN { use_ok('Imager') } +-d "testout" or mkdir "testout"; + require_ok('Imager::Font::Wrap'); my $img = Imager->new(xsize=>400, ysize=>400); diff --git a/t/t82inline.t b/t/t82inline.t index da61334c..c4e24a25 100644 --- a/t/t82inline.t +++ b/t/t82inline.t @@ -16,6 +16,8 @@ plan skip_all => "Inline won't work in directories with spaces" plan skip_all => "perl 5.005_04, 5.005_05 too buggy" if $] =~ /^5\.005_0[45]$/; +-d "testout" or mkdir "testout"; + plan tests => 9; require Inline; Inline->import(with => 'Imager'); diff --git a/t/t90cc.t b/t/t90cc.t index 253db3f2..50a9158e 100644 --- a/t/t90cc.t +++ b/t/t90cc.t @@ -4,6 +4,8 @@ use Test::More tests => 16; use Imager; +-d "testout" or mkdir "testout"; + Imager::init('log'=>'testout/t90cc.log'); { diff --git a/t/x11rubthru.t b/t/x11rubthru.t index f1903688..f71ad660 100644 --- a/t/x11rubthru.t +++ b/t/x11rubthru.t @@ -7,6 +7,8 @@ use Test::More; $Imager::formats{"tiff"} or plan skip_all => "no tiff support"; +-d "testout" or mkdir "testout"; + plan tests => 2; my $dest = Imager->new(xsize => 100, ysize => 100, channels => 4);