From 12fb730de9ce241bbb9f5accaf3ef7378d7f310d Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 12 Mar 2022 21:30:37 +0000 Subject: New stdin tests; test whether output is actually produced git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4305 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/stdin-pam2.test | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'test/stdin-pam2.test') diff --git a/test/stdin-pam2.test b/test/stdin-pam2.test index 8c18afde..f47df604 100755 --- a/test/stdin-pam2.test +++ b/test/stdin-pam2.test @@ -18,22 +18,27 @@ for testprog in \ do ${testprog} ${small_pbm} ${small_pbm} > ${out1}; status1=$? ${testprog} ${small_pbm} < ${small_pbm} > ${out2}; status2=$? + test -s ${out1}; status3=$? cmp -s ${out1} ${out2} - echo ${testprog}": "${status1} ${status2} $? + echo ${testprog}": "${status1} ${status2} ${status3} $? rm ${out1} ${out2} - done +done + dicestem=${tmpdir}/dice testprog="pamdice -outstem=${dicestem}" - ${testprog} ${small_pbm}; status1=$? + ${testprog} ${small_pbm}; status1=$? cat ${dicestem}_*_*.pbm > ${out1} rm ${dicestem}_*_*.pbm ${testprog} < ${small_pbm}; status2=$? cat ${dicestem}_*_*.pbm > ${out2} rm ${dicestem}_*_*.pbm + test -s ${out1}; status3=$? cmp -s ${out1} ${out2} - echo pamdice: ${status1} ${status2} $? + echo pamdice: ${status1} ${status2} ${status3} $? + # Do not use testprog, which contains a variable, in the above + # Same for pamlookup, pamunlookup rm ${out1} ${out2} lookup_ppm=${tmpdir}/lookup.ppm @@ -49,15 +54,17 @@ EOF testprog="pamlookup -lookupfile=${lookup_ppm}" ${testprog} ${small_pbm} > ${out1}; status1=$? ${testprog} < ${small_pbm} > ${out2}; status2=$? + test -s ${out1}; status3=$? cmp -s ${out1} ${out2} - echo pamlookup": "${status1} ${status2} $? + echo pamlookup": "${status1} ${status2} ${status3} $? rm ${out2} testprog="pamunlookup -lookupfile=${lookup_ppm}" ${testprog} ${out1} > ${out3}; status1=$? ${testprog} < ${out1} > ${out4}; status2=$? + test -s ${out1}; status3=$? cmp -s ${out3} ${out4} - echo pamunlookup": "${status1} ${status2} $? + echo pamunlookup": "${status1} ${status2} ${status3} $? rm ${out1} ${out3} ${out4} rm ${lookup_ppm} ${small_pbm} -- cgit 1.4.1