diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-02-27 04:27:49 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-02-27 04:27:49 +0000 |
commit | 1f2fb04372fb195cddc650c8c049e2be0d4132e9 (patch) | |
tree | 43fa3bc7f265f68fa12715e69e39e0eafc1cc875 /test/stdin-pam2.test | |
parent | 5e1a7a822c4e00da643e12c48bebdb298e7b3093 (diff) | |
download | netpbm-mirror-1f2fb04372fb195cddc650c8c049e2be0d4132e9.tar.gz netpbm-mirror-1f2fb04372fb195cddc650c8c049e2be0d4132e9.tar.xz netpbm-mirror-1f2fb04372fb195cddc650c8c049e2be0d4132e9.zip |
New tests for pnmpad and pam editors, converters
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4284 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/stdin-pam2.test')
-rwxr-xr-x | test/stdin-pam2.test | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/stdin-pam2.test b/test/stdin-pam2.test new file mode 100755 index 00000000..8c18afde --- /dev/null +++ b/test/stdin-pam2.test @@ -0,0 +1,63 @@ +#! /bin/bash +# This script tests: pammasksharpen pammixmulti pamdice +# This script tests: pamlookup pamunlookup +# Also requires: pbmmake + +tmpdir=${tmpdir:-/tmp} +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 +small_pbm=${tmpdir}/small.pbm + +pbmmake -g 3 3 > ${small_pbm} + +for testprog in \ + pammasksharpen \ + pammixmulti + do + ${testprog} ${small_pbm} ${small_pbm} > ${out1}; status1=$? + ${testprog} ${small_pbm} < ${small_pbm} > ${out2}; status2=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} $? + rm ${out1} ${out2} + done + + dicestem=${tmpdir}/dice + + testprog="pamdice -outstem=${dicestem}" + ${testprog} ${small_pbm}; status1=$? + cat ${dicestem}_*_*.pbm > ${out1} + rm ${dicestem}_*_*.pbm + ${testprog} < ${small_pbm}; status2=$? + cat ${dicestem}_*_*.pbm > ${out2} + rm ${dicestem}_*_*.pbm + cmp -s ${out1} ${out2} + echo pamdice: ${status1} ${status2} $? + rm ${out1} ${out2} + +lookup_ppm=${tmpdir}/lookup.ppm + +cat > ${lookup_ppm} <<EOF +P3 +2 1 +2 +0 0 0 +0 1 2 +EOF + + testprog="pamlookup -lookupfile=${lookup_ppm}" + ${testprog} ${small_pbm} > ${out1}; status1=$? + ${testprog} < ${small_pbm} > ${out2}; status2=$? + cmp -s ${out1} ${out2} + echo pamlookup": "${status1} ${status2} $? + rm ${out2} + + testprog="pamunlookup -lookupfile=${lookup_ppm}" + ${testprog} ${out1} > ${out3}; status1=$? + ${testprog} < ${out1} > ${out4}; status2=$? + cmp -s ${out3} ${out4} + echo pamunlookup": "${status1} ${status2} $? + rm ${out1} ${out3} ${out4} + +rm ${lookup_ppm} ${small_pbm} |