| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2007.09.13 19:41 "Re: bug reporting and state-of-the-project query", by Lee HowardBob Friesenhahn wrote: > What is needed are a set of small Unix shell scripts designed to fit > into libtiff's existing test suite. These scripts would test libtiff > using the libtiff utilities. Besides validating libtiff, this would > help validate the utilities used. > > Care to volunteer? Attached is a start. I typically only use bilevel images, and so this script only tests the basic functionality of the bilevel utilities. I would be happy to continue to develop this test script to test more thoroughly the specific features of the various utilities as well as set up tests for color or greyscale images, but I don't have a lot of time right now to do it, and this start should get us going in the right direction (and hopefully will see some fixes made and discussion generated). I assume that you have a set of bilevel TIFF test images. Simply run this script against each one like this: ./libtiff-test_utilities-bilevel filename.tif The expected output is merely a stream of lines like this: Testing fax2ps ... success Testing tiffsplit ... success Testing tiffinfo ... success Testing tiffdump ... success If the utilitiy produces unexpected output (i.e. output on stderr) it will be displayed and if the utilitiy exits with a non-zero value then "FAILED" will be displayed as well. Tested against 3.9.0beta I get failed tests on these tests: Testing tiff2ps -1 ... FAILED! Testing tiff2ps -2 ... FAILED! Testing tiff2ps -3 ... FAILED! Testing tiff2pdf ... FAILED! And I get unexpected (stderr) output on those tests (expected error messages) as well as what appears to be debugging output (that should probably not be displayed by default) on the thumbnail test. If you need a bilevel image to test with you can get one here: http://bugzilla.remotesensing.org/show_bug.cgi?id=1585 Thanks, Lee. #!/bin/sh if [ ! -r $1 ]; then echo "This script only takes one bi-level TIFF file as an input option." exit 1 fi # # test tiffsplit simple functionality # printf "Testing tiffsplit ... " tiffsplit $1 deleteme-$$ if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$-*.tif # # test tiffinfo with "additional display" features # printf "Testing tiffinfo ... " tiffinfo -c -D -d -j -s $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi # # test tiffdump # printf "Testing tiffdump ... " tiffdump $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi # # test tiffcp # printf "Testing tiffcp -c g3 ... " tiffcp -c g3 $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif printf "Testing tiffcp -c g3:1d ... " tiffcp -c g3:1d $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif printf "Testing tiffcp -c g3:2d ... " tiffcp -c g3:2d $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif printf "Testing tiffcp -c g3:1d:fill ... " tiffcp -c g3:1d:fill $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif printf "Testing tiffcp -c g3:2d:fill ... " tiffcp -c g3:2d:fill $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif printf "Testing tiffcp -c g4 ... " tiffcp -c g4 $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif printf "Testing tiffcp -c jbig ... " tiffcp -c jbig $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.tif # # test tiffsplit + tiffcp (split-then-rejoin) # printf "Testing tiffsplit + tiffcp ..." mkdir deleteme-$$ tiffcp $1 deleteme-$$/original.tif if [ $? != 0 ]; then echo "FAILED!" else cd deleteme-$$ tiffsplit original.tif if [ $? != 0 ]; then echo "FAILED!" else tiffcp * new.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi fi cd .. fi rm -rf deleteme-$$ # # test tiff2ps # printf "Testing tiff2ps -1 ... " tiff2ps -a -1 $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi printf "Testing tiff2ps -2 ... " tiff2ps -a -2 $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi printf "Testing tiff2ps -3 ... " tiff2ps -a -3 $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi printf "Testing tiff2ps -e ... " tiff2ps -a -e -1 $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi # # test tiff2pdf # printf "Testing tiff2pdf ... " tiff2pdf -o deleteme-$$.pdf $1 if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme-$$.pdf # # test thumbnail # printf "Testing thumbnail ... " tiffcp -c g3:1d $1 deleteme-$$.tif if [ $? != 0 ]; then echo "FAILED!" else thumbnail deleteme-$$.tif deleteme2-$$.tif if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi rm -f deleteme2-$$.tif fi rm -f deleteme-$$.tif # # test fax2ps # printf "Testing fax2ps ... " fax2ps $1 > /dev/null if [ $? != 0 ]; then echo "FAILED!" else echo "success" fi |
|||||||