1 # Common code fragment for tests
6 SRCDIR
=`cd $SRCDIR && pwd`
7 TOPSRCDIR
=`cd $srcdir/.. && pwd`
8 TOOLS
=`cd ../tools && pwd`
9 IMAGES
="${SRCDIR}/images"
11 # Aliases for built tools
12 BMP2TIFF
=${TOOLS}/bmp2tiff
13 FAX2PS
=${TOOLS}/fax2ps
14 FAX2TIFF
=${TOOLS}/fax2tiff
15 GIF2TIFF
=${TOOLS}/gif2tiff
16 PAL2RGB
=${TOOLS}/pal2rgb
17 PPM2TIFF
=${TOOLS}/ppm2tiff
18 RAS2TIFF
=${TOOLS}/ras2tiff
19 RAW2TIFF
=${TOOLS}/raw2tiff
20 RGB2YCBCR
=${TOOLS}/rgb2ycbcr
21 THUMBNAIL
=${TOOLS}/thumbnail
22 TIFF2BW
=${TOOLS}/tiff2bw
23 TIFF2PDF
=${TOOLS}/tiff2pdf
24 TIFF2PS
=${TOOLS}/tiff2ps
25 TIFF2RGBA
=${TOOLS}/tiff2rgba
26 TIFFCMP
=${TOOLS}/tiffcmp
27 TIFFCP
=${TOOLS}/tiffcp
28 TIFFCROP
=${TOOLS}/tiffcrop
29 TIFFDITHER
=${TOOLS}/tiffdither
30 TIFFDUMP
=${TOOLS}/tiffdump
31 TIFFINFO
=${TOOLS}/tiffinfo
32 TIFFMEDIAN
=${TOOLS}/tiffmedian
33 TIFFSET
=${TOOLS}/tiffset
34 TIFFSPLIT
=${TOOLS}/tiffsplit
36 # Aliases for input test files
37 IMG_MINISBLACK_1C_16B
=${IMAGES}/minisblack
-1c-16b.tiff
38 IMG_MINISBLACK_1C_8B
=${IMAGES}/minisblack
-1c-8b.tiff
39 IMG_MINISWHITE_1C_1B
=${IMAGES}/miniswhite
-1c-1b.tiff
40 IMG_PALETTE_1C_1B
=${IMAGES}/palette
-1c-1b.tiff
41 IMG_PALETTE_1C_4B
=${IMAGES}/palette
-1c-4b.tiff
42 IMG_PALETTE_1C_8B
=${IMAGES}/palette
-1c-8b.tiff
43 IMG_RGB_3C_16B
=${IMAGES}/rgb
-3c-16b.tiff
44 IMG_RGB_3C_8B
=${IMAGES}/rgb
-3c-8b.tiff
45 IMG_MINISBLACK_2C_8B_ALPHA
=${IMAGES}/minisblack
-2c-8b-alpha.tiff
47 IMG_PALETTE_1C_8B_BMP
=${IMAGES}/palette
-1c-8b.bmp
48 IMG_RGB_3C_8B_BMP
=${IMAGES}/rgb
-3c-8b.bmp
50 IMG_PALETTE_1C_8B_GIF
=${IMAGES}/palette
-1c-8b.gif
52 IMG_MINISWHITE_1C_1B_PBM
=${IMAGES}/miniswhite
-1c-1b.pbm
53 IMG_MINISBLACK_1C_8B_PGM
=${IMAGES}/minisblack
-1c-8b.pgm
54 IMG_RGB_3C_8B_PPM
=${IMAGES}/rgb
-3c-8b.ppm
56 # All uncompressed image files
57 IMG_UNCOMPRESSED
="${IMG_MINISBLACK_1C_16B} ${IMG_MINISBLACK_1C_8B} ${IMG_MINISWHITE_1C_1B} ${IMG_PALETTE_1C_1B} ${IMG_PALETTE_1C_4B} ${IMG_PALETTE_1C_4B} ${IMG_PALETTE_1C_8B} ${IMG_RGB_3C_8B}"
60 # Test a simple convert-like command.
62 # f_test_convert command infile outfile
69 echo "$MEMCHECK $command $infile $outfile"
70 eval $MEMCHECK $command $infile $outfile
72 if [ $status != 0 ] ; then
73 echo "Returned failed status $status!"
74 echo "Output (if any) is in \"${outfile}\"."
80 # Test a simple command which sends output to stdout
82 # f_test_stdout command infile outfile
89 echo "$MEMCHECK $command $infile > $outfile"
90 eval $MEMCHECK $command $infile > $outfile
92 if [ $status != 0 ] ; then
93 echo "Returned failed status $status!"
94 echo "Output (if any) is in \"${outfile}\"."
100 # Execute a simple command (e.g. tiffinfo) with one input file
102 # f_test_exec command infile
107 echo "$MEMCHECK $command $infile"
108 eval $MEMCHECK $command $infile
110 if [ $status != 0 ] ; then
111 echo "Returned failed status $status!"
117 # Execute tiffinfo on a specified file to validate it
119 # f_tiffinfo_validate infile
120 f_tiffinfo_validate
()
122 f_test_reader
"$TIFFINFO -D" $1
125 if test "$VERBOSE" = TRUE