diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:29:32 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:29:32 +0000 |
commit | 23ce26f64c34e30951ad9ade2151552ed77e7357 (patch) | |
tree | d73b31a0c2f7c7be4a69f8a8e84e00dd39c432b5 /test/stdin-pnm2.test | |
parent | 1b6e51a266008348ad93ed8b6ac9ec91b5024fea (diff) | |
download | netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.gz netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.xz netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.zip |
promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4558 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/stdin-pnm2.test')
-rwxr-xr-x | test/stdin-pnm2.test | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/test/stdin-pnm2.test b/test/stdin-pnm2.test new file mode 100755 index 00000000..7622c279 --- /dev/null +++ b/test/stdin-pnm2.test @@ -0,0 +1,91 @@ +#! /bin/sh +# This script tests: pnmtofiasco fiascotopnm +# This script tests: pnmtojbig jbigtopnm +# This script tests: pnmtojpeg jpegtopnm +# This script tests: pnmtopalm palmtopnm +# This script tests: pnmtopng pngtopam +# This script tests: pnmtops pstopnm +# This script tests: pnmtorast rasttopnm +# This script tests: pnmtorle rletopnm +# This script tests: pnmtosgi sgitopnm +# This script tests: pnmtosir sirtopnm +# This script tests: pnmtoxwd xwdtopnm +# This script tests: pnmtotiffcmyk tifftopnm +# Also requires: pgmramp + +tmpdir=${tmpdir:-/tmp} +test_pgm=${tmpdir}/test.pgm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +pgmramp -diag 32 32 > ${test_pgm} + +echo "Test. Should print (command): 0 0 0" +echo "The following are exceptions: should print (command): 0 0 0 1" +echo "pnmtops, pstopnm, pnmtoxwd, pnmtotiffcmyk" +echo + +export NO_ADD_RLE_HISTORY=1 +# Suppress command-line sequence, execution time in pnmtorle header + +for fmt in \ + fiasco \ + jbig \ + jpeg \ + palm \ + png \ + ps \ + rast \ + rle \ + sgi \ + sir \ + xwd \ + tiffcmyk + do + + if [ ${fmt} = "fiasco" ] + then testprog1="pnmto"${fmt}" --progress-meter 0 "; + else + testprog1="pnmto"${fmt}; + fi + + if [ ${fmt} = "png" ] + then testprog2="pngtopam"; + elif [ ${fmt} = "ps" ] + then testprog2="pstopnm -stdout "; + elif [ ${fmt} = "tiffcmyk" ] + then testprog2="tifftopnm"; + else + testprog2=${fmt}"topnm"; + fi + + ${testprog1} ${test_pgm} > ${out1}; status1=$? + ${testprog1} < ${test_pgm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog1}": "${status1} ${status2} ${status3} $? + rm ${out2} + + ${testprog2} ${out1} > ${out3}; status4=$? + ${testprog2} < ${out1} > ${out4}; status5=$? + test -s ${out3}; status6=$? + cmp -s ${out3} ${out4} + echo ${testprog2}": "${status4} ${status5} ${status6} $? + rm ${out1} ${out3} ${out4} + + done + +rm ${test_pgm} + + +# pnmtofiasco width, height must be even and at least 32 +# use --progressmeter option to suppress progress meter +# +# pnmtojbig input must be bilevel black-white or gray +# pnmtops input file name embedded in output +# pnmtotiffcmyk input file name embedded in output +# "Standard input" if from stdin +# pnmtoxwd input file name embedded in output +# "stdin" if from stdin |