in reply to Re^2: Stopping tests
in thread Stopping tests

G'day Bod,

Your link to Image::Square (https://metacpan.org/pod/Image::Square) results in "Not Found". Please fix that.

After jumping through some hoops I managed to locate and download https://cpan.metacpan.org/authors/id/B/BO/BOD/Image-Square-0.01_3.tar.gz which contained:

ken@titan ~/tmp/bod_tmp/Image-Square-0.01_3/t $ ls -l total 2601 ... -rw-r--r-- 1 ken None 2315428 Sep 13 07:29 CoventryCathedral.png -rw-r--r-- 1 ken None 330858 Sep 13 07:29 decoration.png ...

I'm fairly certain that the point the AM was making was in relation to the size of these test files.

The CoventryCathedral.png image is 1584×625 pixels. I'd suggest creating an image of maybe 15x6 pixels (or similar small size) for testing; this would reduce the size of your test data, and hence your module tarball, by some orders of magnitude.

— Ken

Replies are listed 'Best First'.
Re^4: Stopping tests
by Bod (Parson) on Sep 13, 2023 at 22:42 UTC
    The CoventryCathedral.png image is 1584×625 pixels. I'd suggest creating an image of maybe 15x6 pixels (or similar small size) for testing

    Ah...I see!

    I'm reluctant to create a smaller image because in the real world, the module needs to work with all sizes of images. That's why the two test images are different sizes. Some test configurations fail with the larger image but pass with the smaller image. If I use a smaller test image, the test may pass but the module fail when used to process a larger image.

      Apologies for the very tardy reply. I've been tied up with all sorts of things of late. I had intended to respond but that seems to have fallen through the cracks (just noticed it whilst reviewing some of my recent posts).

      Anyway, I wouldn't include any images with the distribution. I'd create them on the fly: the size issue disappears and there's much more flexibility. Something like this (untested) code:

      #!perl use strict; use warnings; use GD; use Test::More; my $tests_per_image = 3; my @widths_to_test = qw{1 10 50 100 500 1000 1500}; my @heights_to_test = qw{1 10 50 100 500 1000 1500}; plan tests => @widths_to_test * @heights_to_test * $tests_per_image; for my $w (@widths_to_test) { for my $h (@heights_to_test) { my $png = GD::Image::->new($w, $h)->png(); # Run tests on $png } }

      — Ken