Test-VariousBits-3

NAME

SYNOPSIS

# command line
perl -MTest::Without::GD=-gif,-png myprog.pl ...
# or in script
use Test::Without::GD '-jpeg';
# or by method
use Test::Without::GD;
Test::Without::GD->without_png();

DESCRIPTION

This module mangles the GD module to pretend that some of its file formats are not available, as can happen if libgd was built without some of its supporting libraries, or some configs set in the GD module, etc.

This can be used for testing to check how module code etc behaves without some of GD's things, or to exercise .t scripts to see that they skip checks for features not available.

The mangling is done by deleting or replacing selected GD::Image methods. Deleting uses Sub::Delete (perhaps that will change). There's an experimental no Test::Without::GD which tries to restore GD::Image back to normal operation. Is there any value in that? Usually the fakery will be for the duration of a script etc.

IMPORT OPTIONS

The module import recognises the following options

-png
-jpeg
-gif
-gifanim
-xpm

They correspond to the without_png() etc functions below. So for example to pretend PNG is not available,

perl -MTest::Without::GD=-png myprog.pl ...

Or when using the usual ExtUtils::MakeMaker harness,

HARNESS_PERL_SWITCHES="-MTest::Without::GD=-png" make test

The options can be applied from a script too (or the functions below used),

use Test::Without::GD '-png';

FUNCTIONS

Test::Without::GD->without_png()

Test::Without::GD->without_jpeg()

Test::Without::GD->without_gif()

Pretend that PNG, JPEG or GIF format is not available. This means removing the respective GD::Image methods,

SEE ALSO

HOME PAGE

http://user42.tuxfamily.org/test-variousbits/index.html

COPYRIGHT

Copyright 2011, 2012 Kevin Ryde

Test-VariousBits is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Test-VariousBits is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Test-VariousBits. If not, see <http://www.gnu.org/licenses/>.