about summary refs log tree commit diff
path: root/test/ps-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-01-02 16:28:37 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-01-02 16:28:37 +0000
commit71d4c2e05abc34d82d505c96af9bd918846f9cec (patch)
tree41e3c5cc4dcba05e59843dbed2cf8f4eca2c98d2 /test/ps-roundtrip.test
parente165c1cd02e9ea5b868b0a43b20e1bd96d40e6ff (diff)
downloadnetpbm-mirror-71d4c2e05abc34d82d505c96af9bd918846f9cec.tar.gz
netpbm-mirror-71d4c2e05abc34d82d505c96af9bd918846f9cec.tar.xz
netpbm-mirror-71d4c2e05abc34d82d505c96af9bd918846f9cec.zip
use aliases to make tests easier to read and modify; add white line to top in Pnmshear test
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2098 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ps-roundtrip.test')
-rwxr-xr-xtest/ps-roundtrip.test40
1 files changed, 26 insertions, 14 deletions
diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test
index b7aa816c..3aff4274 100755
--- a/test/ps-roundtrip.test
+++ b/test/ps-roundtrip.test
@@ -2,41 +2,53 @@
 # 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
+
+# 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 -xborder=0 -yborder=0 $xysize1 -stdout \
+  pstopnm -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 -xborder=0 -yborder=0 $xysize2 -stdout \
+  pstopnm -xborder=0 -yborder=0 $xysize2 -stdout \
     -quiet ${tmpdir}/testgrid.ps -pbm | \
-    ${PBM_BINPREFIX}pnmtopnm | cksum
+    pnmtopnm | cksum
   done
 
 
@@ -56,13 +68,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 -xborder=0 -yborder=0 $xysize3 \
+pstopnm -xborder=0 -yborder=0 $xysize3 \
     -stdout  ${tmpdir}/testimg5.ps | \
-  ${PBM_BINPREFIX}pnmtopnm | cksum
+  pnmtopnm | cksum
   done