3 # tests Imager with every combination of options
4 my @opts = qw(jpeg tiff png gif ungif T1-fonts TT-fonts freetype2);
6 # each option gets a bit
8 @bits{@opts} = map { 1 << $_ } 0..(@opts-1);
10 my $perl = $ENV{PERLBIN} || "perl";
11 my $make = $ENV{MAKEBIN} || "make";
12 my $makeopts = $ENV{MAKEOPTS} || '';
15 getopts('vd', \%opts);
17 my $top = (1 << @opts)-1;
21 unlink('testout/bigtest.txt');
24 system("$make clean") if -e 'Makefile' && !$opts{d};
25 for my $set (0..$top) {
27 $ENV{IM_ENABLE} = join(' ', grep($set & $bits{$_}, @opts));
28 print STDERR $opts{v} ? "$set/$top Enable: $ENV{IM_ENABLE}\n" : '.';
29 system("echo '****' \$IM_ENABLE >>testout/bigtest.txt");
31 if (system("$make $makeopts disttest >>testout/bigtest.txt 2>&1")) {
32 push(@results, [ $ENV{IM_ENABLE}, 'disttest failed' ]);
38 if (system("$perl Makefile.PL >>testout/bigtest.txt 2>&1")) {
39 push(@results, [ $ENV{IM_ENABLE}, 'Makefile.PL failed' ]);
42 if (system("$make $makeopts >>testout/bigtest.txt 2>&1")) {
43 push(@results, [ $ENV{IM_ENABLE}, 'make failed' ]);
46 if (system("$make test >>testout/bigtest.txt 2>&1")) {
47 push(@results, [ $ENV{IM_ENABLE}, 'test failed' ]);
50 if (system("$make clean >>testout/bigtest.txt 2>&1")) {
51 push(@results, [ $ENV{IM_ENABLE}, 'clean failed' ]);
56 push(@results, [ $ENV{IM_ENABLE}, 'success' ]);
60 printf("%-20s %-50s\n", "Result", "Options");
61 printf("%-20s %-50s\n", "-" x 20, "-" x 50);
62 foreach my $row (@results) {
63 printf("%-20s %-50s\n", @$row[1,0]);
66 print "Total: $total Successes: $good Failures: ",$total-$good,"\n";
67 print "Output in testout/bigtest.txt\n";
73 bigtest.perl - tests combinations of libraries usable by Imager
78 # grab a cup of coffee or four - this takes a while
82 bigtest.perl uses the new IM_ENABLE environment variable of
83 Makefile.PL to built Imager for all possible combinations of libraries
86 At the time of writing this is 128 combinations, which takes quite a
93 -d - perform disttest for each combination
95 =head1 ENVIRONMENT VARIABLES
97 PERLBIN - the perl binary to use
99 MAKEBIN - the make binary to use
101 Any other variables used by Imager's Makefile.PL, except for IM_MANUAL
106 Doesn't test other possible options, like IM_NOLOG or IM_DEBUG_MALLOC.
110 Tony Cook <tony@develop-help.com>