diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-02-03 01:26:10 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-02-03 01:26:10 +0000 |
commit | be71d9f416a205d4dd977b93f5f96f97e8628cca (patch) | |
tree | 0426e2bf871948b1a3994a74671f75a3ec8a06e0 /test/stdin-ppm3.test | |
parent | 458cce2de894fb6d9383896d1cbd309ece582b34 (diff) | |
download | netpbm-mirror-be71d9f416a205d4dd977b93f5f96f97e8628cca.tar.gz netpbm-mirror-be71d9f416a205d4dd977b93f5f96f97e8628cca.tar.xz netpbm-mirror-be71d9f416a205d4dd977b93f5f96f97e8628cca.zip |
Add stdin tests, et al
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4272 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/stdin-ppm3.test')
-rwxr-xr-x | test/stdin-ppm3.test | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/test/stdin-ppm3.test b/test/stdin-ppm3.test new file mode 100755 index 00000000..e21718d0 --- /dev/null +++ b/test/stdin-ppm3.test @@ -0,0 +1,72 @@ +#! /bin/sh +# This script tests: ppmtobmp bmptopnm ppmtoilbm ilbmtoppm ppmtoleaf leaftoppm +# This script tests: ppmtoneo neotoppm ppmtopcx pcxtoppm ppmtopi1 pi1toppm +# This script tests: ppmtopict picttoppm ppmtopj pjtoppm ppmtospu sputoppm +# This script tests: ppmtoxpm xpmtoppm +# Also requires: ppmmake + +tmpdir=${tmpdir:-/tmp} +test_ppm=${tmpdir}/test.ppm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 + +ppmmake -maxval 7 rgb:00/00/00 320 200 > ${test_ppm} + +tmpdir=${tmpdir:-/tmp} +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +for fmt in \ + bmp \ + ilbm \ + leaf \ + neo \ + pcx \ + pi1 \ + pict \ + pj \ + spu \ + xpm + do + testprog1="ppmto"${fmt} + if [ ${fmt} = "bmp" ] + then testprog2=${fmt}"topnm"; + else testprog2=${fmt}"toppm"; + fi + + ${testprog1} ${test_ppm} > ${out1}; status1=$? + ${testprog1} < ${test_ppm} > ${out2}; status2=$? + if [ ${fmt} = "xpm" ] + then + sed -i '/^static char/s/static char .* = {/static char file/' \ + ${out1} ${out2}; + fi + cmp -s ${out1} ${out2} + diff ${out1} ${out2} + echo ${testprog1}": "${status1} ${status2} $? + + ${testprog2} ${out1} > ${out3}; status3=$? + ${testprog2} < ${out1} > ${out4}; status4=$? + cmp -s ${out3} ${out4} + echo ${testprog2}": "${status3} ${status4} $? + done + +# asciitopgm +# bmptopnm + +# winicontopam + +# spu width=320 height=200 fixed + +# eyuvtoppm width, height is mandatory +# yuvtoppm width, height is mandatory + +# winicontoppm max size 255 255 + +# xpm maxval 15 or larger + +# yuvsplit splits output into three files + +# ppmtowinicon winicontoppm legacy |