diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-03-30 17:12:47 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2014-03-30 17:12:47 +0000 |
commit | 04afde0b11367018d95be801c543fdcf16420b5d (patch) | |
tree | 8c1ecbdf40aa57ff7fe47234708e3a2995d2b641 /test/ps-roundtrip.test | |
parent | fbf4dcdf76bf004ea45a762e8399268cc388ae19 (diff) | |
download | netpbm-mirror-04afde0b11367018d95be801c543fdcf16420b5d.tar.gz netpbm-mirror-04afde0b11367018d95be801c543fdcf16420b5d.tar.xz netpbm-mirror-04afde0b11367018d95be801c543fdcf16420b5d.zip |
Update to current Development release - 10.66.00
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2172 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ps-roundtrip.test')
-rwxr-xr-x | test/ps-roundtrip.test | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test index 92925064..1877724d 100755 --- a/test/ps-roundtrip.test +++ b/test/ps-roundtrip.test @@ -2,41 +2,58 @@ # This script tests: pnmtops pstopnm # Also requires: pnmtopnm pamtopnm gs pbmmake pnmshear pnmpad pnmcat + alias pnmtops="${PBM_TESTPREFIX}pnmtops" + alias pstopnm="${PBM_TESTPREFIX}pstopnm" + alias pbmmake="${PBM_BINPREFIX}pbmmake" + alias pnmcat="${PBM_BINPREFIX}pnmcat" + alias pnmpad="${PBM_BINPREFIX}pnmpad" + alias pnmshear="${PBM_BINPREFIX}pnmshear" + alias pnmtopnm="${PBM_BINPREFIX}pnmtopnm" + shopt -s expand_aliases + +# Failure message +## This test fails when: +## (1) zlib was not linked. +## (2) ghostscript is not available. + +# pstopnm does not use libnetpbm functions for output. +# Output is filtered through pnmtopnm. + # Test 1. Should print: 1926073387 101484 five times # *NOTE* Fifth iteration fails if pnmtops was compiled without zlib # (flate compression) support. for flag in "" "-ps" "-rle" "-ps -ascii" "-ps -flate" do - ${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn \ + pnmtops -nocenter -equalpixels -dpi 72 -noturn \ ${flag} testimg.ppm \ > ${tmpdir}/testimg.ps xysize1=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ ${tmpdir}/testimg.ps` - ${PBM_TESTPREFIX}pstopnm -portrait -xborder=0 -yborder=0 $xysize1 -stdout \ + pstopnm -portrait -xborder=0 -yborder=0 $xysize1 -stdout \ -quiet ${tmpdir}/testimg.ps | \ - ${PBM_BINPREFIX}pnmtopnm | cksum + pnmtopnm | cksum done # Test 2. Should print: 2918318199 62 seven times # Test image designed to detect problems with run-length compression # -${PBM_BINPREFIX}pbmmake -g 2 2 > ${tmpdir}/g.pbm -${PBM_BINPREFIX}pbmmake -g 8 4 | \ - ${PBM_BINPREFIX}pnmshear 45 -noantialias -background=black | \ - ${PBM_BINPREFIX}pnmpad -right 60 | \ - ${PBM_BINPREFIX}pnmcat -tb -jright - ${tmpdir}/g.pbm > ${tmpdir}/t.pbm && +pbmmake -g 2 2 > ${tmpdir}/g.pbm +pbmmake -g 8 4 | \ + pnmshear 45 -noantialias -background=black | \ + pnmpad -right 60 | \ + pnmcat -tb -jright - ${tmpdir}/g.pbm > ${tmpdir}/t.pbm && for flag in "" "-rle" "-ps -rle -ascii" \ "-bitspersample=2 -rle" "-ps -bitspersample=4 -rle" \ "-bitspersample=8 -rle" "-ps -bitspersample=12 -rle -dict" do - ${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn \ + pnmtops -nocenter -equalpixels -dpi 72 -noturn \ ${flag} ${tmpdir}/t.pbm > ${tmpdir}/testgrid.ps && xysize2=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \ ${tmpdir}/testgrid.ps` - ${PBM_TESTPREFIX}pstopnm -portrait -xborder=0 -yborder=0 $xysize2 -stdout \ + pstopnm -portrait -xborder=0 -yborder=0 $xysize2 -stdout \ -quiet ${tmpdir}/testgrid.ps -pbm | \ - ${PBM_BINPREFIX}pnmtopnm | cksum + pnmtopnm | cksum done @@ -56,13 +73,13 @@ for flag in "" "-ps" \ "-ps -bitspersample=12 -flate -rle -vmreclaim" do cat testimg.ppm testimg.ppm testimg.ppm testgrid.pbm testgrid.pbm | \ -${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \ +pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \ ${flag} > ${tmpdir}/testimg5.ps xysize3=`awk '/BoundingBox/ {print "-xsize="$4,"-ysize="$5 ; exit}' \ ${tmpdir}/testimg5.ps` -${PBM_TESTPREFIX}pstopnm -portrait -xborder=0 -yborder=0 $xysize3 \ +pstopnm -portrait -xborder=0 -yborder=0 $xysize3 \ -stdout ${tmpdir}/testimg5.ps | \ - ${PBM_BINPREFIX}pnmtopnm | cksum + pnmtopnm | cksum done |