about summary refs log tree commit diff
path: root/test/ps-alt-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-07-06 22:04:28 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-07-06 22:04:28 +0000
commit2a82091a45d67cadfc93148176a446ffd67021f6 (patch)
tree97de970b798441206a6294867eac8a8b9ea49b3b /test/ps-alt-roundtrip.test
parent9ebbf59ad1a4272a182172f190908ea3f4d7227b (diff)
downloadnetpbm-mirror-2a82091a45d67cadfc93148176a446ffd67021f6.tar.gz
netpbm-mirror-2a82091a45d67cadfc93148176a446ffd67021f6.tar.xz
netpbm-mirror-2a82091a45d67cadfc93148176a446ffd67021f6.zip
Use red plane of testimg.ppm for test PGM input; rewrite file names which use tmpdir in the manner of symmetry.test; add some failure messages
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2225 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ps-alt-roundtrip.test')
-rwxr-xr-xtest/ps-alt-roundtrip.test33
1 files changed, 22 insertions, 11 deletions
diff --git a/test/ps-alt-roundtrip.test b/test/ps-alt-roundtrip.test
index 8c4cfc2a..d61e55d9 100755
--- a/test/ps-alt-roundtrip.test
+++ b/test/ps-alt-roundtrip.test
@@ -19,38 +19,49 @@
 #
 # pbmtopsg3 and pbmtolps produce output that require pstopnm for decoding.
 #
-# If ps-roundtrip.test succeeds and this test fails, it is most likely
-# a problem with one of the minor utilities, and vice versa.
+# Failure message
+## If ps-roundtrip.test succeeds and this test fails, it is most likely
+## a problem with one of the alternate Postscipt utilities:
+## pbmtoepsi, pbmtopsg3, pbmtolps or psidtopgm.
+## If both tests fail it indicates a problem with pstopnm or gs.
 
 # pstopnm does not use libnetpbm functions for output. 
 # Output is filtered through pnmtopnm.
 
 # Test 1. Should print: 2425386270 41
+testgrid1_ps=${tmpdir}/testgrid1.ps
+
 pbmtopsg3 -dpi=72 testgrid.pbm \
-     > ${tmpdir}/testgrid1.ps && \
+     > ${testgrid1_ps} && \
 pstopnm -xborder=0 -yborder=0 -llx=0 -lly=-16 -urx=14 \
-    -dpi=72 -stdout -quiet -pbm ${tmpdir}/testgrid1.ps | \
+    -dpi=72 -stdout -quiet -pbm ${testgrid1_ps} | \
     pnmcrop | cksum
 
+rm ${testgrid1_ps}
+
 
 # Test 2. Should print: 2425386270 41
+testgrid2_ps=${tmpdir}/testgrid2.ps
+
 pbmtolps -dpi 72 testgrid.pbm \
-     > ${tmpdir}/testgrid2.ps && \
+     > ${testgrid2_ps} && \
 pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \
-    -quiet ${tmpdir}/testgrid2.ps -pbm | \
+    -quiet ${testgrid2_ps} -pbm | \
   pnmcrop | cksum
 
+rm ${testgrid2_ps}
 
 # Test 3. Should print: 2916080186 235
 # Output is pgm maxval=1 with black and white inverted.
 #
-pbmtoepsi testgrid.pbm > ${tmpdir}/testgrid.epsi && \
+testgrid_epsi=${tmpdir}/testgrid.epsi 
+
+pbmtoepsi testgrid.pbm > ${testgrid_epsi} && \
 xysizebps=`awk  '/BeginPreview/ {print $2,$3,$4}' \
-    ${tmpdir}/testgrid.epsi` && \
+    ${testgrid_epsi}` && \
 awk '/^%%BeginPreview:/ { p=1; next } /^%%EndImage/ { p=0; next } \
   p==1 && /%[ \t0-9a-fA-F]+/ { print substr($0,2); next } \
   p==1 {print "!"$0}' \
-    ${tmpdir}/testgrid.epsi | psidtopgm $xysizebps | cksum
-
+    ${testgrid_epsi} | psidtopgm $xysizebps | cksum
 
-rm ${tmpdir}/testgrid[12].ps  ${tmpdir}/testgrid.epsi 
+rm ${testgrid_epsi}