aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrysn <chrysn@fsfe.org>2014-07-15 14:03:00 +0200
committerchrysn <chrysn@fsfe.org>2014-07-15 14:03:00 +0200
commita0a26d24f9c551a6c955c0b27ae8e69ea7ddb740 (patch)
treeda71b7ca1d6588d5a2ae0b2e1cd047cbd5f9513c
parentfa2a4d0db472f7fc85ef3d6c6e6ba2786793f637 (diff)
downloadikiwiki-a0a26d24f9c551a6c955c0b27ae8e69ea7ddb740.tar
ikiwiki-a0a26d24f9c551a6c955c0b27ae8e69ea7ddb740.tar.gz
make img unittest easier to debug
-rwxr-xr-xt/img.t21
1 files changed, 12 insertions, 9 deletions
diff --git a/t/img.t b/t/img.t
index 0183f8779..ba28d2734 100755
--- a/t/img.t
+++ b/t/img.t
@@ -43,7 +43,8 @@ ok(! system($command));
sub size($) {
my $filename = shift;
my $im = Image::Magick->new();
- $im->Read($filename);
+ my $r = $im->Read($filename);
+ return "no image" if $r;
my $w = $im->Get("width");
my $h = $im->Get("height");
return "${w}x${h}";
@@ -58,17 +59,19 @@ is(size("$outpath/16x-p1-twopages.png"), "16x2");
# now let's remove them again
-writefile("imgconversions.mdwn", "t/tmp/in", "nothing to see here");
+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-simple.png");
-ok(! -e "$outpath/10x-simple-svg.png");
-ok(! -e "$outpath/10x-simple-pdf.png");
-ok(! -e "$outpath/10x-p1-simple-pdf.png");
+ ok(! -e "$outpath/10x-simple.png");
+ ok(! -e "$outpath/10x-simple-svg.png");
+ ok(! -e "$outpath/10x-simple-pdf.png");
+ ok(! -e "$outpath/10x-p1-simple-pdf.png");
-# cleanup
-ok(! system("rm -rf t/tmp"));
+ # cleanup
+ ok(! system("rm -rf t/tmp"));
+}
done_testing;
1;