From be71d9f416a205d4dd977b93f5f96f97e8628cca Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 3 Feb 2022 01:26:10 +0000 Subject: Add stdin tests, et al git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4272 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/stdin-pbm1.test | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 test/stdin-pbm1.test (limited to 'test/stdin-pbm1.test') 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 (?) -- cgit 1.4.1