about summary refs log tree commit diff
path: root/test/stdin-pbm1.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-02-03 01:26:10 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-02-03 01:26:10 +0000
commitbe71d9f416a205d4dd977b93f5f96f97e8628cca (patch)
tree0426e2bf871948b1a3994a74671f75a3ec8a06e0 /test/stdin-pbm1.test
parent458cce2de894fb6d9383896d1cbd309ece582b34 (diff)
downloadnetpbm-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-pbm1.test')
-rwxr-xr-xtest/stdin-pbm1.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/stdin-pbm1.test b/test/stdin-pbm1.test
new file mode 100755
index 00000000..2155b3fa
--- /dev/null
+++ b/test/stdin-pbm1.test
@@ -0,0 +1,43 @@
+#! /bin/sh
+# This script tests: pbmclean pbmlife pbmmask pbmminkowski pbmtoepsi
+# This script tests: pbmtopsg3 pbmpscale pbmreduce pbmtopgm
+# Also requires: pbmmake
+
+# Tests whether output is unchanged when
+# (1) input is a named file: pbm-command input-file
+# (2) input is from stdin:   pbm-command < input-file
+
+tmpdir=${tmpdir:-/tmp}
+out1=${tmpdir}/out1
+out2=${tmpdir}/out2
+out3=${tmpdir}/out3
+out4=${tmpdir}/out4
+small_pbm=${tmpdir}/small.pbm
+
+pbmmake -b 3 3 > ${small_pbm}
+
+for testprog in \
+        pbmclean \
+        pbmlife \
+        pbmmask \
+        pbmminkowski \
+        pbmtoepsi \
+        pbmtopsg3 \
+        "pbmpscale 1 " \
+        "pbmreduce -threshold 2 " \
+        "pbmtopgm 2 2 "
+  do
+  ${testprog} ${small_pbm} > ${out1};      status1=$?
+  ${testprog} < ${small_pbm} > ${out2};    status2=$?
+  cmp -s ${out1} ${out2}
+  echo ${testprog}": "${status1} ${status2} $?
+  done
+
+rm ${small_pbm}
+
+# For Pbm converters not tested here see pbm-misc-converters.test
+
+# These programs do not have a converter in the opposite direction: 
+# Brushtopbm
+# Ddbugtopbm
+# Thinkjettopbm (?)