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;
20 my $testlog = "bigtest.txt";
25 system("$make clean") if -e 'Makefile' && !$opts{d};
26 for my $set (0..$top) {
28 $ENV{IM_ENABLE} = join(' ', grep($set & $bits{$_}, @opts));
29 print STDERR $opts{v} ? "$set/$top Enable: $ENV{IM_ENABLE}\n" : '.';
30 system("echo '****' \$IM_ENABLE >>$testlog");
32 if (system("$make $makeopts disttest >>$testlog.txt 2>&1")) {
33 push(@results, [ $ENV{IM_ENABLE}, 'disttest failed' ]);
39 if (system("$perl Makefile.PL >>$testlog 2>&1")) {
40 push(@results, [ $ENV{IM_ENABLE}, 'Makefile.PL failed' ]);
43 if (system("$make $makeopts >>$testlog 2>&1")) {
44 push(@results, [ $ENV{IM_ENABLE}, 'make failed' ]);
47 if (system("$make test >>$testlog 2>&1")) {
48 push(@results, [ $ENV{IM_ENABLE}, 'test failed' ]);
51 if (system("$make clean >>$testlog 2>&1")) {
52 push(@results, [ $ENV{IM_ENABLE}, 'clean failed' ]);
57 push(@results, [ $ENV{IM_ENABLE}, 'success' ]);
61 printf("%-20s %-50s\n", "Result", "Options");
62 printf("%-20s %-50s\n", "-" x 20, "-" x 50);
63 foreach my $row (@results) {
64 printf("%-20s %-50s\n", @$row[1,0]);
67 print "Total: $total Successes: $good Failures: ",$total-$good,"\n";
68 print "Output in $testlog\n";
74 bigtest.perl - tests combinations of libraries usable by Imager
79 # grab a cup of coffee or four - this takes a while
83 bigtest.perl uses the new IM_ENABLE environment variable of
84 Makefile.PL to built Imager for all possible combinations of libraries
87 At the time of writing this is 128 combinations, which takes quite a
94 -d - perform disttest for each combination
96 =head1 ENVIRONMENT VARIABLES
98 PERLBIN - the perl binary to use
100 MAKEBIN - the make binary to use
102 Any other variables used by Imager's Makefile.PL, except for IM_MANUAL
107 Doesn't test other possible options, like IM_NOLOG or IM_DEBUG_MALLOC.
111 Tony Cook <tony@develop-help.com>