tests/falsecolor_test.pl
changeset 20 a29baf51b980
parent 17 e4ebb10e4697
child 22 617fa1f9ccb3
equal deleted inserted replaced
19:fd9e518890bc 20:a29baf51b980
     8 
     8 
     9 use strict;
     9 use strict;
    10 use warnings;
    10 use warnings;
    11 
    11 
    12 my $script = "falsecolor";
    12 my $script = "falsecolor";
    13 my $csh = "../orig/falsecolor.csh";
    13 my $csh = "../orig/$script.csh";
    14 my $perl = "../bin/falsecolor.perl";
    14 my $perl = "../bin/$script.perl";
    15 print "script: $script\n";
    15 print "script: $script\n";
    16 
    16 
    17 use File::Temp qw/ tempdir /;
    17 use File::Temp qw/ tempdir /;
    18 my $tmpdir = tempdir( CLEANUP => 0 );
    18 my $tmpdir = tempdir( CLEANUP => 0 );
    19 
    19 
    57 		my $diffimg = "$tmpdir/${script}_diff$index.hdr";
    57 		my $diffimg = "$tmpdir/${script}_diff$index.hdr";
    58 		my $uval = &compare_images("$cshout", "$perlout", "$diffimg");
    58 		my $uval = &compare_images("$cshout", "$perlout", "$diffimg");
    59 		if( $uval > 0 ) {
    59 		if( $uval > 0 ) {
    60 			print "      Error: Diff image $diffimg contains $uval unique values (should be one).\n";
    60 			print "      Error: Diff image $diffimg contains $uval unique values (should be one).\n";
    61 			system "ximage $diffimg";
    61 			system "ximage $diffimg";
       
    62 			$fail++;
    62 		} else {
    63 		} else {
    63 			print "      Ok: Images $cshout and $perlout are identical.\n";
    64 			print "      Ok: Images $cshout and $perlout are identical.\n";
    64 			$fail++;
       
    65 		}
    65 		}
    66 }
    66 }
    67 
    67 
    68 print "$fail of $total tests failed.\n";
    68 print "$fail of $total tests failed.\n";
    69 print "temp dir $tmpdir not removed. Please remove manually.\n";
    69 print "temp dir $tmpdir not removed. Please remove manually.\n";