about summary refs log tree commit diff
path: root/test/stdin-ppm2.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/stdin-ppm2.test')
-rwxr-xr-xtest/stdin-ppm2.test51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/stdin-ppm2.test b/test/stdin-ppm2.test
new file mode 100755
index 00000000..63306b1d
--- /dev/null
+++ b/test/stdin-ppm2.test
@@ -0,0 +1,51 @@
+#! /bin/sh
+# This script tests: ppmtoacad ppmtoapplevol ppmtoascii ppmtolj ppmtomitsu
+# This script tests: ppmtopgm ppmtopuzz ppmtosixel ppmtoterm ppmtoicr
+# Also requires: ppmpat
+
+tmpdir=${tmpdir:-/tmp}
+test_ppm=${tmpdir}/test.ppm
+out1=${tmpdir}/out1
+out2=${tmpdir}/out2
+
+ppmpat -g2 -color=rgb:00/00/ff,rgb:ff/00/00 -mesh 12 12 > ${test_ppm}
+
+# These converters do not have counterparts in the reverse direction
+
+for testprog in  \
+        ppmtoacad \
+        ppmtoapplevol \
+        ppmtoascii \
+        ppmtolj \
+        ppmtomitsu \
+        ppmtopgm \
+        ppmtopuzz \
+        ppmtosixel \
+        ppmtoterm
+  do
+  ${testprog} ${test_ppm} > ${out1};      status1=$?
+  ${testprog} < ${test_ppm} > ${out2};    status2=$?
+  cmp -s ${out1} ${out2}
+  echo ${testprog}": "${status1} ${status2} $?
+  rm ${out1} ${out2}
+  done
+
+rm ${test_ppm}
+
+testprog=ppmtoicr
+
+  ${testprog} testgrid.pbm > ${out1};      status1=$?
+  ${testprog} < testgrid.pbm > ${out2};    status2=$?
+  sed 's/untitled/testgrid.pbm/g' ${out2} | cmp -s ${out1} -
+  echo ${testprog}": "${status1} ${status2} $?
+  rm ${out1} ${out2}
+
+# Ppmtoppm input is from standard input
+
+# Ppmtoapplevol height must be 12
+# Ppmtoarbtxt needs body template file
+# Ppmtompeg parameter file must be given
+
+# Ppmtoicr file name embedded in output "untitled" if no name
+
+# Ppmtoyuvsplit produces three output files