From: Simon McVittie Date: Mon, 30 Nov 2015 17:33:00 +0000 (+0000) Subject: Update structure of img test from master X-Git-Tag: debian/3.20141016.3~11 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/aac7073799bfa9aaa4f8beec3cc37b7ad6a48ca9 Update structure of img test from master Originally from commit cdfb4ab "Run autopkgtest tests using autodep8 and the pkg-perl team's infrastructure", cherry-picked here to be able to apply subsequent test coverage extensions in this test. --- diff --git a/t/img.t b/t/img.t index 55cf05afc..012373a79 100755 --- a/t/img.t +++ b/t/img.t @@ -18,6 +18,22 @@ use Test::More; BEGIN { use_ok("IkiWiki"); } BEGIN { use_ok("Image::Magick"); } +my $installed = $ENV{INSTALLED_TESTS}; + +my @command; +if ($installed) { + @command = qw(ikiwiki); +} +else { + ok(! system("make -s ikiwiki.out")); + @command = qw(perl -I. ./ikiwiki.out + --underlaydir=underlays/basewiki + --set underlaydirbase=underlays + --templatedir=templates); +} + +push @command, qw(--set usedirs=0 --plugin img t/tmp/in t/tmp/out --verbose); + my $magick = new Image::Magick; my $SVGS_WORK = defined $magick->QueryFormat("svg"); @@ -67,11 +83,7 @@ EOF ); ok(utime(333333333, 333333333, "t/tmp/in/imgconversions.mdwn")); -ok(! system("make -s ikiwiki.out")); - -my $command = "perl -I. ./ikiwiki.out -set usedirs=0 -templatedir=templates -plugin img t/tmp/in t/tmp/out -verbose"; - -ok(! system($command)); +ok(! system(@command)); sub size($) { my $filename = shift; @@ -114,7 +126,7 @@ is(size("$outpath/x6-a:b:c:d:e:f:g:h:i:j.png"), "6x6"); if (1) { # for easier testing writefile("imgconversions.mdwn", "t/tmp/in", "nothing to see here"); - ok(! system("$command --refresh")); + ok(! system(@command, "--refresh")); ok(! -e "$outpath/10x-redsquare.png"); ok(! -e "$outpath/10x-bluesquare.png");